Skip to content

Commit 9f7e633

Browse files
committed
Dockerfile.test: build critools in a separate stage
Building critools only requires the install script and the critools-version file (to determin the version to build). Moving it to a separate stage prevents rebuilding it if unrelated changes are made in the code. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 7ec8e2d commit 9f7e633

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

contrib/Dockerfile.test

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ COPY script/setup/install-cni ./
4343
COPY go.mod /go/src/github.com/containerd/containerd/go.mod
4444
RUN ./install-cni
4545

46+
FROM golang AS critools
47+
ARG DESTDIR=/build
48+
COPY script/setup/install-critools script/setup/critools-version ./
49+
RUN GOBIN=$DESTDIR/usr/local/bin ./install-critools
50+
4651
# cri-in-userns stage is for testing "CRI-in-UserNS", which should be used in conjunction with
4752
# "Kubelet-in-UserNS": https://github.com/kubernetes/enhancements/tree/master/keps/sig-node/2033-kubelet-in-userns-aka-rootless
4853
# This feature is mostly expected to be used for `kind` and `minikube`.
@@ -55,8 +60,8 @@ COPY contrib/Dockerfile.test.d/cri-in-userns/etc_containerd_config.toml /etc/con
5560
COPY contrib/Dockerfile.test.d/cri-in-userns/docker-entrypoint.sh /docker-entrypoint.sh
5661
COPY --from=runc /build/ /
5762
COPY --from=cni /build/ /
63+
COPY --from=critools /build/ /
5864
COPY . .
59-
RUN ./script/setup/install-critools
6065
RUN make BUILDTAGS="no_btrfs no_devmapper" binaries install
6166
VOLUME /var/lib/containerd
6267
ENTRYPOINT ["/docker-entrypoint.sh"]

0 commit comments

Comments
 (0)