2
2
3
3
# Do not update runc to v1.2.x until https://github.com/opencontainers/runc/issues/4518 is resolved
4
4
ARG RUNC_VERSION=v1.1.15
5
- ARG CONTAINERD_VERSION=v1.7.23
6
- # CONTAINERD_ALT_VERSION_16 defines fallback containerd version for integration tests
5
+ ARG CONTAINERD_VERSION=v2.0.0
6
+ # CONTAINERD_ALT_VERSION_... defines fallback containerd version for integration tests
7
+ ARG CONTAINERD_ALT_VERSION_17=v1.7.23
7
8
ARG CONTAINERD_ALT_VERSION_16=v1.6.36
8
9
ARG REGISTRY_VERSION=v2.8.3
9
10
ARG ROOTLESSKIT_VERSION=v2.3.1
@@ -207,54 +208,52 @@ RUN apk add --no-cache fuse3 git openssh pigz xz iptables ip6tables \
207
208
COPY --link examples/buildctl-daemonless/buildctl-daemonless.sh /usr/bin/
208
209
VOLUME /var/lib/buildkit
209
210
210
- FROM gobuild-base AS containerd
211
+ FROM gobuild-base AS containerd-build
211
212
WORKDIR /go/src/github.com/containerd/containerd
212
- ARG CONTAINERD_VERSION
213
- ADD --keep-git-dir=true "https://github.com/containerd/containerd.git#$CONTAINERD_VERSION" .
214
213
ARG TARGETPLATFORM
215
214
ENV CGO_ENABLED=1 BUILDTAGS=no_btrfs GO111MODULE=off
216
215
RUN xx-apk add musl-dev gcc && xx-go --wrap
217
- RUN --mount=target=/root/.cache,type=cache <<EOT
218
- set -ex
219
- mkdir /out
220
- ext=""
216
+ COPY --chmod=755 <<-EOT /build.sh
217
+ # !/bin/sh
218
+ set -ex
219
+ mkdir /out
220
+ if [ "$(xx-info os)" = "linux" ]; then
221
+ make bin/containerd
222
+ make bin/containerd-shim-runc-v2
223
+ mv bin/containerd bin/containerd-shim* /out
224
+ else
225
+ CGO_ENABLED=0 make STATIC=1 binaries
221
226
if [ "$(xx-info os)" = "windows" ]; then
222
- ext=".exe"
223
- fi
224
- if [ "$(xx-info os)" = "linux" ]; then
225
- make bin/containerd
226
- make bin/containerd-shim-runc-v2
227
- mv bin/containerd bin/containerd-shim* /out
227
+ mv bin/containerd.exe /out
228
228
else
229
- CGO_ENABLED=0 make STATIC=1 binaries
230
- mv bin/containerd${ext} bin/containerd-shim* /out
229
+ mv bin/containerd /out
230
+ fi
231
+ # No shim binary is built for FreeBSD, since containerd v2.0.
232
+ if ls bin/containerd-shim* >/dev/null 2>&1; then
233
+ mv bin/containerd-shim* /out
231
234
fi
235
+ fi
232
236
EOT
233
237
238
+ FROM containerd-build AS containerd
239
+ WORKDIR /go/src/github.com/containerd/containerd
240
+ ARG CONTAINERD_VERSION
241
+ ADD --keep-git-dir=true "https://github.com/containerd/containerd.git#$CONTAINERD_VERSION" .
242
+ RUN /build.sh
243
+
244
+ # containerd-alt-17 builds containerd v1.7 for integration tests
245
+ FROM containerd-build AS containerd-alt-17
246
+ WORKDIR /go/src/github.com/containerd/containerd
247
+ ARG CONTAINERD_ALT_VERSION_17
248
+ ADD --keep-git-dir=true "https://github.com/containerd/containerd.git#$CONTAINERD_ALT_VERSION_17" .
249
+ RUN /build.sh
250
+
234
251
# containerd-alt-16 builds containerd v1.6 for integration tests
235
- FROM gobuild-base AS containerd-alt-16
252
+ FROM containerd-build AS containerd-alt-16
236
253
WORKDIR /go/src/github.com/containerd/containerd
237
254
ARG CONTAINERD_ALT_VERSION_16
238
255
ADD --keep-git-dir=true "https://github.com/containerd/containerd.git#$CONTAINERD_ALT_VERSION_16" .
239
- ARG TARGETPLATFORM
240
- ENV CGO_ENABLED=1 BUILDTAGS=no_btrfs GO111MODULE=off
241
- RUN xx-apk add musl-dev gcc && xx-go --wrap
242
- RUN --mount=target=/root/.cache,type=cache <<EOT
243
- set -ex
244
- mkdir /out
245
- ext=""
246
- if [ "$(xx-info os)" = "windows" ]; then
247
- ext=".exe"
248
- fi
249
- if [ "$(xx-info os)" = "linux" ]; then
250
- make bin/containerd
251
- make bin/containerd-shim-runc-v2
252
- mv bin/containerd bin/containerd-shim* /out
253
- else
254
- CGO_ENABLED=0 make STATIC=1 binaries
255
- mv bin/containerd${ext} bin/containerd-shim* /out
256
- fi
257
- EOT
256
+ RUN /build.sh
258
257
259
258
FROM gobuild-base AS registry
260
259
WORKDIR /go/src/github.com/docker/distribution
@@ -391,7 +390,7 @@ RUN curl -Ls https://raw.githubusercontent.com/moby/moby/v25.0.1/hack/dind > /do
391
390
&& chmod 0755 /docker-entrypoint.sh
392
391
ENTRYPOINT ["/docker-entrypoint.sh" ]
393
392
# musl is needed to directly use the registry binary that is built on alpine
394
- ENV BUILDKIT_INTEGRATION_CONTAINERD_EXTRA="containerd-1.6=/opt/containerd-alt-16/bin"
393
+ ENV BUILDKIT_INTEGRATION_CONTAINERD_EXTRA="containerd-1.7=/opt/containerd-alt-17/bin,containerd-1. 6=/opt/containerd-alt-16/bin"
395
394
ENV BUILDKIT_INTEGRATION_SNAPSHOTTER=stargz
396
395
ENV BUILDKIT_SETUP_CGROUPV2_ROOT=1
397
396
ENV CGO_ENABLED=0
@@ -402,6 +401,7 @@ COPY --link --from=minio-mc /usr/bin/mc /usr/bin/
402
401
COPY --link --from=nydus /out/nydus-static/* /usr/bin/
403
402
COPY --link --from=stargz-snapshotter /out/* /usr/bin/
404
403
COPY --link --from=rootlesskit /rootlesskit /usr/bin/
404
+ COPY --link --from=containerd-alt-17 /out/containerd* /opt/containerd-alt-17/bin/
405
405
COPY --link --from=containerd-alt-16 /out/containerd* /opt/containerd-alt-16/bin/
406
406
COPY --link --from=registry /out /usr/bin/
407
407
COPY --link --from=runc /usr/bin/runc /usr/bin/
0 commit comments