1
- FROM linuxkit/ alpine:146f540f25cd92ec8ff0c5b0c98342a9a95e479e AS builder
1
+ FROM alpine:3.22 AS builder
2
2
3
3
ARG TARGETPLATFORM
4
4
@@ -7,38 +7,38 @@ ARG TARGETPLATFORM
7
7
# `test/pkg/containerd/Dockerfile` when changing this.
8
8
ENV CONTAINERD_REPO=https://github.com/containerd/containerd.git
9
9
10
- ENV CONTAINERD_COMMIT=v1.7.15
11
- ENV NERDCTL_VERSION=1.7.6
10
+ ENV CONTAINERD_COMMIT=v2.1.3
11
+ ENV NERDCTL_VERSION=2.1.2
12
12
ENV GOPATH=/go
13
- RUN apk add go git
13
+ RUN apk add go=1.24.4-r0 git
14
14
RUN mkdir -p $GOPATH/src/github.com/containerd && \
15
15
cd $GOPATH/src/github.com/containerd && \
16
16
git clone https://github.com/containerd/containerd.git && \
17
17
cd $GOPATH/src/github.com/containerd/containerd && \
18
18
git checkout $CONTAINERD_COMMIT
19
19
RUN apk add --no-cache btrfs-progs-dev gcc libc-dev linux-headers make libseccomp-dev
20
20
WORKDIR $GOPATH/src/github.com/containerd/containerd
21
- RUN make binaries EXTRA_FLAGS="-buildmode pie" EXTRA_LDFLAGS='-w -s -extldflags "-fno-PIC -static"' BUILDTAGS="static_build no_devmapper"
21
+ RUN make binaries STATIC=1 EXTRA_FLAGS="-buildmode pie" EXTRA_LDFLAGS='-w -s -extldflags "-fno-PIC -static"' BUILDTAGS="static_build no_devmapper"
22
22
23
23
# install nerdctl
24
24
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then ARCHITECTURE=amd64; elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then ARCHITECTURE=arm64; else ARCHITECTURE=amd64; fi \
25
25
&& wget https://github.com/containerd/nerdctl/releases/download/v${NERDCTL_VERSION}/nerdctl-${NERDCTL_VERSION}-linux-${ARCHITECTURE}.tar.gz \
26
26
&& tar -zxvf nerdctl-${NERDCTL_VERSION}-linux-${ARCHITECTURE}.tar.gz -C /usr/local/bin/
27
27
28
- RUN cp bin/containerd bin/ctr bin/containerd-shim bin/containerd-shim -runc-v2 /usr/bin/
29
- RUN strip /usr/bin/containerd /usr/bin/ctr /usr/bin/containerd-shim /usr/bin/containerd-shim -runc-v2
28
+ RUN cp bin/containerd bin/ctr bin/containerd-shim-runc-v2 /usr/bin/
29
+ RUN strip /usr/bin/containerd /usr/bin/ctr /usr/bin/containerd-shim-runc-v2
30
30
RUN mkdir -p /opt/containerd
31
31
32
32
FROM scratch AS containerd-dev
33
33
ENTRYPOINT []
34
34
WORKDIR /
35
- COPY --from=builder /usr/bin/containerd /usr/bin/ctr /usr/bin/containerd-shim /usr/bin/containerd-shim -runc-v2 /usr/bin/
35
+ COPY --from=builder /usr/bin/containerd /usr/bin/ctr /usr/bin/containerd-shim-runc-v2 /usr/bin/
36
36
COPY --from=builder /go/src/github.com/containerd/containerd /go/src/github.com/containerd/containerd
37
37
COPY --from=builder /usr/local/bin/nerdctl /usr/bin/
38
38
COPY --from=builder /opt/containerd/ /opt/containerd/
39
39
40
40
# Dockerfile to build linuxkit/containerd for linuxkit
41
- FROM linuxkit/ alpine:146f540f25cd92ec8ff0c5b0c98342a9a95e479e AS alpine
41
+ FROM alpine:3.22 AS alpine
42
42
43
43
RUN apk add tzdata binutils
44
44
RUN mkdir -p /etc/init.d && ln -s /usr/bin/service /etc/init.d/020-containerd
@@ -48,7 +48,7 @@ FROM containerd-dev
48
48
FROM scratch
49
49
ENTRYPOINT []
50
50
WORKDIR /
51
- COPY --from=containerd-dev /usr/bin/containerd /usr/bin/ctr /usr/bin/containerd-shim /usr/bin/containerd-shim -runc-v2 /usr/bin/
51
+ COPY --from=containerd-dev /usr/bin/containerd /usr/bin/ctr /usr/bin/containerd-shim-runc-v2 /usr/bin/
52
52
COPY --from=containerd-dev /usr/bin/nerdctl /usr/bin/
53
53
COPY --from=containerd-dev /opt/containerd/ /opt/containerd/
54
54
COPY --from=alpine /usr/share/zoneinfo/UTC /etc/localtime
0 commit comments