Make image build process a bit simpler
Take full leverage of multi-stage docker build.
This commit is contained in:
parent
93eca1cb8e
commit
7eb6b35cb0
|
@ -23,8 +23,7 @@ build_linux() {
|
||||||
# Linux Alpine based Docker image
|
# Linux Alpine based Docker image
|
||||||
name="$DOCKER_BASE-alpine"
|
name="$DOCKER_BASE-alpine"
|
||||||
DOCKER_BUILDS="$DOCKER_BUILDS $name"
|
DOCKER_BUILDS="$DOCKER_BUILDS $name"
|
||||||
sed -e '/DELETE-MARKER/,$d' Dockerfile > Dockerfile.alpine
|
docker build -f Dockerfile -t "$name:current" --target alpine .
|
||||||
docker build -f Dockerfile.alpine -t "$name:current" .
|
|
||||||
docker run "$name:current" sh -c 'shellcheck --version'
|
docker run "$name:current" sh -c 'shellcheck --version'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ RUN mkdir -p /out/bin && \
|
||||||
cp shellcheck /out/bin/
|
cp shellcheck /out/bin/
|
||||||
|
|
||||||
# Resulting Alpine image
|
# Resulting Alpine image
|
||||||
FROM alpine:latest
|
FROM alpine:latest AS alpine
|
||||||
LABEL maintainer="Vidar Holen <vidar@vidarholen.net>"
|
LABEL maintainer="Vidar Holen <vidar@vidarholen.net>"
|
||||||
COPY --from=build /out /
|
COPY --from=build /out /
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue