Dockerfile.test: clean up apt indexes after installing
Not critical for intermediate stages, but a minor optimization to reduce the image cache. Ideally, this would use cache-mounts for this, but those may not be supported by podman, so taking the traditional approach. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
9f7e6335c4
commit
8faacfca16
@ -16,9 +16,9 @@ FROM golang:${GOLANG_VERSION} AS golang
|
|||||||
|
|
||||||
# Install runc
|
# Install runc
|
||||||
FROM golang AS runc
|
FROM golang AS runc
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
libseccomp-dev \
|
libseccomp-dev \
|
||||||
--no-install-recommends
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY script/setup/runc-version script/setup/install-runc ./
|
COPY script/setup/runc-version script/setup/install-runc ./
|
||||||
# Allow overriding the version of runc to install through build-args
|
# Allow overriding the version of runc to install through build-args
|
||||||
@ -28,12 +28,12 @@ ARG DESTDIR=/build
|
|||||||
RUN ./install-runc
|
RUN ./install-runc
|
||||||
|
|
||||||
FROM golang AS build-env
|
FROM golang AS build-env
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
libbtrfs-dev \
|
libbtrfs-dev \
|
||||||
btrfs-progs \
|
btrfs-progs \
|
||||||
libseccomp-dev \
|
libseccomp-dev \
|
||||||
xfsprogs \
|
xfsprogs \
|
||||||
--no-install-recommends
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
RUN mkdir -p /go/src/github.com/containerd/containerd
|
RUN mkdir -p /go/src/github.com/containerd/containerd
|
||||||
WORKDIR /go/src/github.com/containerd/containerd
|
WORKDIR /go/src/github.com/containerd/containerd
|
||||||
|
|
||||||
@ -55,7 +55,9 @@ RUN GOBIN=$DESTDIR/usr/local/bin ./install-critools
|
|||||||
# Requires Rootless Docker/Podman/nerdctl with cgroup v2 delegation: https://rootlesscontaine.rs/getting-started/common/cgroup2/
|
# Requires Rootless Docker/Podman/nerdctl with cgroup v2 delegation: https://rootlesscontaine.rs/getting-started/common/cgroup2/
|
||||||
# (Rootless Docker/Podman/nerdctl prepares the UserNS, so we do not need to create UserNS by ourselves)
|
# (Rootless Docker/Podman/nerdctl prepares the UserNS, so we do not need to create UserNS by ourselves)
|
||||||
FROM build-env AS cri-in-userns
|
FROM build-env AS cri-in-userns
|
||||||
RUN apt-get update && apt-get install -y iptables
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
|
iptables \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
COPY contrib/Dockerfile.test.d/cri-in-userns/etc_containerd_config.toml /etc/containerd/config.toml
|
COPY contrib/Dockerfile.test.d/cri-in-userns/etc_containerd_config.toml /etc/containerd/config.toml
|
||||||
COPY contrib/Dockerfile.test.d/cri-in-userns/docker-entrypoint.sh /docker-entrypoint.sh
|
COPY contrib/Dockerfile.test.d/cri-in-userns/docker-entrypoint.sh /docker-entrypoint.sh
|
||||||
COPY --from=runc /build/ /
|
COPY --from=runc /build/ /
|
||||||
@ -78,7 +80,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
automake \
|
automake \
|
||||||
g++ \
|
g++ \
|
||||||
libtool \
|
libtool \
|
||||||
unzip
|
unzip \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY script/setup/install-protobuf install-protobuf
|
COPY script/setup/install-protobuf install-protobuf
|
||||||
RUN ./install-protobuf \
|
RUN ./install-protobuf \
|
||||||
|
Loading…
Reference in New Issue
Block a user