summaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
authorCrazyMax <crazy-max@users.noreply.github.com>2022-11-18 00:23:20 +0100
committerCrazyMax <crazy-max@users.noreply.github.com>2022-11-22 17:07:54 +0100
commit8a46a2a364ccf1219b64ea7e3ee1bba7ae8fad7b (patch)
tree3bb7d9836f310139b08c0de87d4e198407b98165 /Dockerfile
parent7f4431d2f69c0f6d7816256dad182d9bf9cc77cd (diff)
downloaddocker-8a46a2a364ccf1219b64ea7e3ee1bba7ae8fad7b.tar.gz
Dockerfile: remove hardcoded platforms for vpnkit stage
Current Dockerfile downloads vpnkit for both linux/amd64 and linux/arm64 platforms even if target platform does not match. This change will download vpnkit only if target platform matches, otherwise it will just use a dummy scratch stage. Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile23
1 files changed, 14 insertions, 9 deletions
diff --git a/Dockerfile b/Dockerfile
index ff16faad3c..feafd581f4 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -289,13 +289,18 @@ RUN --mount=type=tmpfs,target=/tmp/crun-build \
./configure --bindir=/build && \
make -j install
-FROM --platform=amd64 djs55/vpnkit:${VPNKIT_VERSION} AS vpnkit-amd64
-
-FROM --platform=arm64 djs55/vpnkit:${VPNKIT_VERSION} AS vpnkit-arm64
-
-FROM scratch AS vpnkit
-COPY --from=vpnkit-amd64 /vpnkit /build/vpnkit.x86_64
-COPY --from=vpnkit-arm64 /vpnkit /build/vpnkit.aarch64
+# vpnkit
+# use dummy scratch stage to avoid build to fail for unsupported platforms
+FROM scratch AS vpnkit-windows
+FROM scratch AS vpnkit-linux-386
+FROM scratch AS vpnkit-linux-arm
+FROM scratch AS vpnkit-linux-ppc64le
+FROM scratch AS vpnkit-linux-riscv64
+FROM scratch AS vpnkit-linux-s390x
+FROM djs55/vpnkit:${VPNKIT_VERSION} AS vpnkit-linux-amd64
+FROM djs55/vpnkit:${VPNKIT_VERSION} AS vpnkit-linux-arm64
+FROM vpnkit-linux-${TARGETARCH} AS vpnkit-linux
+FROM vpnkit-${TARGETOS} AS vpnkit
# TODO: Some of this is only really needed for testing, it would be nice to split this up
FROM runtime-dev AS dev-systemd-false
@@ -369,7 +374,7 @@ COPY --from=shfmt /build/ /usr/local/bin/
COPY --from=runc /build/ /usr/local/bin/
COPY --from=containerd /build/ /usr/local/bin/
COPY --from=rootlesskit /build/ /usr/local/bin/
-COPY --from=vpnkit /build/ /usr/local/bin/
+COPY --from=vpnkit / /usr/local/bin/
COPY --from=crun /build/ /usr/local/bin/
COPY hack/dockerfile/etc/docker/ /etc/docker/
ENV PATH=/usr/local/cli:$PATH
@@ -416,7 +421,7 @@ COPY --from=tini /build/ /usr/local/bin/
COPY --from=runc /build/ /usr/local/bin/
COPY --from=containerd /build/ /usr/local/bin/
COPY --from=rootlesskit /build/ /usr/local/bin/
-COPY --from=vpnkit /build/ /usr/local/bin/
+COPY --from=vpnkit / /usr/local/bin/
COPY --from=gowinres /build/ /usr/local/bin/
WORKDIR /go/src/github.com/docker/docker