mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-18 17:37:46 +08:00
dockerfile: add release target
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
parent
e7e57b626d
commit
9bfc02d707
10
Dockerfile
10
Dockerfile
@ -53,6 +53,16 @@ COPY --from=buildx-build /usr/bin/buildx /buildx.exe
|
|||||||
|
|
||||||
FROM binaries-$TARGETOS AS binaries
|
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
|
FROM alpine AS demo-env
|
||||||
RUN apk add --no-cache iptables tmux git vim less
|
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
|
RUN mkdir -p /usr/local/lib/docker/cli-plugins && ln -s /usr/local/bin/buildx /usr/local/lib/docker/cli-plugins/docker-buildx
|
||||||
|
Loading…
x
Reference in New Issue
Block a user