fix(Makefile, Dockerfile): use build-args

This commit is contained in:
2019-11-12 21:42:16 +01:00
parent b634834a3e
commit 4eb41e8dfa
2 changed files with 35 additions and 18 deletions

View File

@ -1,9 +1,19 @@
FROM volkerraschek/build-image:1.4.0 AS build-env
ARG BASE_IMAGE
ARG BUILD_IMAGE
ARG EXECUTABLE_TARGET
ARG VERSION
# BUILD
# ==============================================================================
FROM ${BUILD_IMAGE} AS build-env
ADD ./ /workspace
RUN make bin/linux/amd64/dhdu
RUN make clean ${EXECUTABLE_TARGET} GOPROXY=${GOPROXY}
FROM busybox:latest
COPY --from=build-env /workspace/bin/linux/amd64/dhdu /usr/bin/dhdu
# TARGET
# ==============================================================================
FROM ${BASE_IMAGE}
COPY --from=build-env /workspace/${EXECUTABLE_TARGET} /usr/bin/dhdu
RUN chmod +x /usr/bin/dhdu
ENTRYPOINT [ "/usr/bin/dhdu" ]