Skip to content

Commit 9537bc2

Browse files
committed
Dockerfile.test: build containerd in separate stage
Looking at how this image is used, I think we don't even need the source in the final image, so we can build containerd in a separate stage, and copy the binaries. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 36be5ef commit 9537bc2

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

contrib/Dockerfile.test

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ ARG DESTDIR=/build
4949
COPY script/setup/install-critools script/setup/critools-version ./
5050
RUN GOBIN=$DESTDIR/usr/local/bin ./install-critools
5151

52+
FROM build-env AS containerd
53+
ARG DESTDIR=/build
54+
COPY . .
55+
RUN make BUILDTAGS="no_btrfs no_devmapper" binaries install
56+
5257
# cri-in-userns stage is for testing "CRI-in-UserNS", which should be used in conjunction with
5358
# "Kubelet-in-UserNS": https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/2033-kubelet-in-userns-aka-rootless
5459
# This feature is mostly expected to be used for `kind` and `minikube`.
@@ -64,8 +69,7 @@ COPY contrib/Dockerfile.test.d/cri-in-userns/docker-entrypoint.sh /docker-
6469
COPY --from=runc /build/ /
6570
COPY --from=cni /build/ /
6671
COPY --from=critools /build/ /
67-
COPY . .
68-
RUN make BUILDTAGS="no_btrfs no_devmapper" binaries install
72+
COPY --from=containerd /build/ /
6973
VOLUME /var/lib/containerd
7074
ENTRYPOINT ["/docker-entrypoint.sh"]
7175
# Skip "runtime should support unsafe sysctls": `container init caused: write sysctl key fs.mqueue.msg_max: open /proc/sys/fs/mqueue/msg_max: permission denied`

0 commit comments

Comments
 (0)