Multistage Docker build

This commit is contained in:
cimnine
2021-09-20 14:18:48 +02:00
parent 1827b16ade
commit f28c8bc1c2
3 changed files with 32 additions and 7 deletions

View File

@@ -2,10 +2,12 @@
set -e
echo "Build binary using golang docker image"
docker run --rm -ti \
-v "`pwd`":/go/src/github.com/restic/restic \
-w /go/src/github.com/restic/restic golang:1.16-alpine go run build.go
export DOCKER_BUILDKIT=${DOCKER_BUILDKIT-1}
echo "Build docker image restic/restic:latest"
docker build --rm -t restic/restic:latest -f docker/Dockerfile .
docker build \
--rm \
--pull \
--file docker/Dockerfile \
--tag restic/restic:latest \
.