From 9bfc02d707c55ec1a01c74ab2df4a4f2fb1c8990 Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Wed, 24 Apr 2019 17:54:56 -0700 Subject: [PATCH] dockerfile: add release target Signed-off-by: Tonis Tiigi --- Dockerfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Dockerfile b/Dockerfile index e42dfe46..da88d519 100644 --- a/Dockerfile +++ b/Dockerfile @@ -53,6 +53,16 @@ COPY --from=buildx-build /usr/bin/buildx /buildx.exe FROM binaries-$TARGETOS AS binaries +FROM --platform=$BUILDPLATFORM alpine AS releaser +WORKDIR /work +ARG TARGETPLATFORM +RUN --mount=from=binaries \ + --mount=source=/tmp/.version,target=/tmp/.version,from=buildx-version \ + mkdir -p /out && cp buildx* "/out/buildx-$(cat /tmp/.version).$(echo $TARGETPLATFORM | sed 's/\//-/g')$(ls buildx* | sed -e 's/^buildx//')" + +FROM scratch AS release +COPY --from=releaser /out/ / + FROM alpine AS demo-env RUN apk add --no-cache iptables tmux git vim less RUN mkdir -p /usr/local/lib/docker/cli-plugins && ln -s /usr/local/bin/buildx /usr/local/lib/docker/cli-plugins/docker-buildx