Adds a release build script

This commit is contained in:
Nemo 2020-04-04 01:53:23 +05:30
parent 1de2b56f4b
commit 0b2867cf2f
3 changed files with 15 additions and 2 deletions

View File

@ -3,3 +3,6 @@ LICENSE
Dockerfile
spec/
bin/
Makefile
.dockerignore
*.Dockerfile

10
Makefile Normal file
View File

@ -0,0 +1,10 @@
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
current_dir := $(notdir $(patsubst %/,%,$(dir $(mkfile_path))))
release:
# Build a static binary and save it in muse-dl-static
docker build --tag muse-dl-static --file static.Dockerfile .
# Then extract the image | extract the layer.tar file (we only have one layer) | extract the muse-dl-static file
docker image save muse-dl-static | tar xf - --wildcards "*/layer.tar" -O | tar xf - "muse-dl-static"
# And move it to the bin/ directory
mv -f muse-dl-static bin/

View File

@ -9,4 +9,4 @@ RUN shards install && \
FROM scratch
COPY --from=builder /build/bin/muse-dl /muse-dl
COPY --from=builder /build/bin/muse-dl /muse-dl-static