From d6eecd2c00330834ba1e257f872f60fe7ddfb1e3 Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Thu, 21 Nov 2024 21:56:41 -0800 Subject: [PATCH] Revert "Dockerfile: update containerd binary to v2.0.0" This reverts commit b1adeed5caf1003ed565a7a89a9174c171a3e247. Signed-off-by: Tonis Tiigi --- .github/workflows/.test.yml | 1 - Dockerfile | 75 ++++++++++++++++++------------------- 2 files changed, 37 insertions(+), 39 deletions(-) diff --git a/.github/workflows/.test.yml b/.github/workflows/.test.yml index cb7043726701..00e2840efe3b 100644 --- a/.github/workflows/.test.yml +++ b/.github/workflows/.test.yml @@ -112,7 +112,6 @@ jobs: - containerd - containerd-rootless - containerd-1.6 - - containerd-1.7 - containerd-snapshotter-stargz - oci - oci-rootless diff --git a/Dockerfile b/Dockerfile index 576c5e3686de..544c27444b07 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,7 @@ # syntax=docker/dockerfile-upstream:master ARG RUNC_VERSION=v1.2.2 -ARG CONTAINERD_VERSION=v2.0.0 -# CONTAINERD_ALT_VERSION_... defines fallback containerd version for integration tests -ARG CONTAINERD_ALT_VERSION_17=v1.7.23 +ARG CONTAINERD_VERSION=v1.7.23 ARG CONTAINERD_ALT_VERSION_16=v1.6.36 ARG REGISTRY_VERSION=v2.8.3 ARG ROOTLESSKIT_VERSION=v2.3.1 @@ -200,52 +198,54 @@ RUN apk add --no-cache fuse3 git openssh pigz xz iptables ip6tables \ COPY --link examples/buildctl-daemonless/buildctl-daemonless.sh /usr/bin/ VOLUME /var/lib/buildkit -FROM gobuild-base AS containerd-build +FROM gobuild-base AS containerd WORKDIR /go/src/github.com/containerd/containerd +ARG CONTAINERD_VERSION +ADD --keep-git-dir=true "https://github.com/containerd/containerd.git#$CONTAINERD_VERSION" . ARG TARGETPLATFORM ENV CGO_ENABLED=1 BUILDTAGS=no_btrfs GO111MODULE=off RUN xx-apk add musl-dev gcc && xx-go --wrap -COPY --chmod=755 <<-EOT /build.sh -#!/bin/sh -set -ex -mkdir /out -if [ "$(xx-info os)" = "linux" ]; then - make bin/containerd - make bin/containerd-shim-runc-v2 - mv bin/containerd bin/containerd-shim* /out -else - CGO_ENABLED=0 make STATIC=1 binaries +RUN --mount=target=/root/.cache,type=cache </dev/null 2>&1; then - mv bin/containerd-shim* /out + if [ "$(xx-info os)" = "linux" ]; then + make bin/containerd + make bin/containerd-shim-runc-v2 + mv bin/containerd bin/containerd-shim* /out + else + CGO_ENABLED=0 make STATIC=1 binaries + mv bin/containerd${ext} bin/containerd-shim* /out fi -fi EOT -FROM containerd-build AS containerd -WORKDIR /go/src/github.com/containerd/containerd -ARG CONTAINERD_VERSION -ADD --keep-git-dir=true "https://github.com/containerd/containerd.git#$CONTAINERD_VERSION" . -RUN /build.sh - -# containerd-alt-17 builds containerd v1.7 for integration tests -FROM containerd-build AS containerd-alt-17 -WORKDIR /go/src/github.com/containerd/containerd -ARG CONTAINERD_ALT_VERSION_17 -ADD --keep-git-dir=true "https://github.com/containerd/containerd.git#$CONTAINERD_ALT_VERSION_17" . -RUN /build.sh - # containerd-alt-16 builds containerd v1.6 for integration tests -FROM containerd-build AS containerd-alt-16 +FROM gobuild-base AS containerd-alt-16 WORKDIR /go/src/github.com/containerd/containerd ARG CONTAINERD_ALT_VERSION_16 ADD --keep-git-dir=true "https://github.com/containerd/containerd.git#$CONTAINERD_ALT_VERSION_16" . -RUN /build.sh +ARG TARGETPLATFORM +ENV CGO_ENABLED=1 BUILDTAGS=no_btrfs GO111MODULE=off +RUN xx-apk add musl-dev gcc && xx-go --wrap +RUN --mount=target=/root/.cache,type=cache < /do && chmod 0755 /docker-entrypoint.sh ENTRYPOINT ["/docker-entrypoint.sh"] # musl is needed to directly use the registry binary that is built on alpine -ENV BUILDKIT_INTEGRATION_CONTAINERD_EXTRA="containerd-1.7=/opt/containerd-alt-17/bin,containerd-1.6=/opt/containerd-alt-16/bin" +ENV BUILDKIT_INTEGRATION_CONTAINERD_EXTRA="containerd-1.6=/opt/containerd-alt-16/bin" ENV BUILDKIT_INTEGRATION_SNAPSHOTTER=stargz ENV BUILDKIT_SETUP_CGROUPV2_ROOT=1 ENV CGO_ENABLED=0 @@ -415,7 +415,6 @@ COPY --link --from=minio-mc /usr/bin/mc /usr/bin/ COPY --link --from=nydus /out/nydus-static/* /usr/bin/ COPY --link --from=stargz-snapshotter /out/* /usr/bin/ COPY --link --from=rootlesskit /rootlesskit /usr/bin/ -COPY --link --from=containerd-alt-17 /out/containerd* /opt/containerd-alt-17/bin/ COPY --link --from=containerd-alt-16 /out/containerd* /opt/containerd-alt-16/bin/ COPY --link --from=registry /out /usr/bin/ COPY --link --from=runc /usr/bin/runc /usr/bin/