From 7eb6b35cb04bcf460f21a96db214fcae1fd0c51a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laurent=20VERDO=C3=8FA?= Date: Sat, 9 Nov 2019 10:26:59 +0100 Subject: [PATCH] Make image build process a bit simpler Take full leverage of multi-stage docker build. --- .compile_binaries | 3 +-- Dockerfile | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.compile_binaries b/.compile_binaries index d015411..2585c14 100755 --- a/.compile_binaries +++ b/.compile_binaries @@ -23,8 +23,7 @@ build_linux() { # Linux Alpine based Docker image name="$DOCKER_BASE-alpine" DOCKER_BUILDS="$DOCKER_BUILDS $name" - sed -e '/DELETE-MARKER/,$d' Dockerfile > Dockerfile.alpine - docker build -f Dockerfile.alpine -t "$name:current" . + docker build -f Dockerfile -t "$name:current" --target alpine . docker run "$name:current" sh -c 'shellcheck --version' } diff --git a/Dockerfile b/Dockerfile index 2b65291..6ca370e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,7 @@ RUN mkdir -p /out/bin && \ cp shellcheck /out/bin/ # Resulting Alpine image -FROM alpine:latest +FROM alpine:latest AS alpine LABEL maintainer="Vidar Holen " COPY --from=build /out /