22
33ARG GO_VERSION=1.20
44ARG XX_VERSION=1.2.1
5- ARG DOCKERD_VERSION=20.10.14
5+
6+ ARG DOCKER_VERSION=24.0.2
67ARG GOTESTSUM_VERSION=v1.9.0
78ARG REGISTRY_VERSION=2.8.0
89ARG BUILDKIT_VERSION=v0.11.6
910
10- FROM docker:$DOCKERD_VERSION AS dockerd-release
11-
1211# xx is a helper for cross-compilation
1312FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
1413
@@ -25,6 +24,22 @@ FROM registry:$REGISTRY_VERSION AS registry
2524
2625FROM moby/buildkit:$BUILDKIT_VERSION AS buildkit
2726
27+ FROM gobase AS docker
28+ ARG TARGETPLATFORM
29+ ARG DOCKER_VERSION
30+ WORKDIR /opt/docker
31+ RUN DOCKER_ARCH=$(case ${TARGETPLATFORM:-linux/amd64} in \
32+ "linux/amd64" ) echo "x86_64" ;; \
33+ "linux/arm/v6" ) echo "armel" ;; \
34+ "linux/arm/v7" ) echo "armhf" ;; \
35+ "linux/arm64" ) echo "aarch64" ;; \
36+ "linux/ppc64le" ) echo "ppc64le" ;; \
37+ "linux/s390x" ) echo "s390x" ;; \
38+ *) echo "" ;; esac) \
39+ && echo "DOCKER_ARCH=$DOCKER_ARCH" \
40+ && wget -qO- "https://download.docker.com/linux/static/stable/${DOCKER_ARCH}/docker-${DOCKER_VERSION}.tgz" | tar xvz --strip 1
41+ RUN ./dockerd --version && ./containerd --version && ./ctr --version && ./runc --version
42+
2843FROM gobase AS gotestsum
2944ARG GOTESTSUM_VERSION
3045ENV GOFLAGS=
@@ -77,9 +92,20 @@ FROM binaries-$TARGETOS AS binaries
7792ARG BUILDKIT_SBOM_SCAN_STAGE=true
7893
7994FROM gobase AS integration-test-base
80- RUN apk add --no-cache docker runc containerd
95+ # https://github.com/docker/docker/blob/master/project/PACKAGERS.md#runtime-dependencies
96+ RUN apk add --no-cache \
97+ btrfs-progs \
98+ e2fsprogs \
99+ e2fsprogs-extra \
100+ ip6tables \
101+ iptables \
102+ openssl \
103+ shadow-uidmap \
104+ xfsprogs \
105+ xz
81106COPY --link --from=gotestsum /out/gotestsum /usr/bin/
82107COPY --link --from=registry /bin/registry /usr/bin/
108+ COPY --link --from=docker /opt/docker/* /usr/bin/
83109COPY --link --from=buildkit /usr/bin/buildkitd /usr/bin/
84110COPY --link --from=buildkit /usr/bin/buildctl /usr/bin/
85111COPY --link --from=binaries /buildx /usr/bin/
@@ -102,7 +128,7 @@ FROM scratch AS release
102128COPY --from=releaser /out/ /
103129
104130# Shell
105- FROM docker:$DOCKERD_VERSION AS dockerd-release
131+ FROM docker:$DOCKER_VERSION AS dockerd-release
106132FROM alpine AS shell
107133RUN apk add --no-cache iptables tmux git vim less openssh
108134RUN mkdir -p /usr/local/lib/docker/cli-plugins && ln -s /usr/local/bin/buildx /usr/local/lib/docker/cli-plugins/docker-buildx
0 commit comments