diff --git a/deploy/kicbase/Dockerfile b/deploy/kicbase/Dockerfile index 776a03601397..f7045f1d7ab0 100644 --- a/deploy/kicbase/Dockerfile +++ b/deploy/kicbase/Dockerfile @@ -4,39 +4,55 @@ ARG COMMIT_SHA # could be changed to any debian that can run systemd FROM kindest/base:v20200430-2c0eee40 as base USER root -# specify version of everything explicitly using 'apt-cache policy' -RUN apt-get update && apt-get install -y --no-install-recommends \ + +# remove files that were installed by kind, replaced by packages +RUN rm \ + /etc/crictl.yaml \ + /etc/systemd/system/containerd.service \ + /etc/systemd/system/multi-user.target.wants/containerd.service \ + /opt/cni/bin/host-local \ + /opt/cni/bin/loopback \ + /opt/cni/bin/portmap \ + /opt/cni/bin/ptp \ + /usr/local/bin/containerd \ + /usr/local/bin/containerd-shim \ + /usr/local/bin/containerd-shim-runc-v2 \ + /usr/local/bin/crictl \ + /usr/local/bin/ctr \ + /usr/local/sbin/runc + +# install system requirements from the regular distro repositories +RUN clean-install \ lz4 \ gnupg \ sudo \ docker.io \ + containerd \ openssh-server \ dnsutils \ runc \ # libglib2.0-0 is required for conmon, which is required for podman - libglib2.0-0 \ - # removing kind's crictl config - && rm /etc/crictl.yaml + libglib2.0-0 # Install cri-o/podman dependencies: RUN sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_20.04/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list" && \ curl -LO https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable/xUbuntu_20.04/Release.key && \ - apt-key add - < Release.key && apt-get update && \ - apt-get install -y --no-install-recommends containers-common catatonit conmon containernetworking-plugins podman-plugins varlink + apt-key add - < Release.key && \ + clean-install containers-common catatonit conmon containernetworking-plugins cri-tools podman-plugins varlink # install cri-o based on https://github.com/cri-o/cri-o/commit/96b0c34b31a9fc181e46d7d8e34fb8ee6c4dc4e1#diff-04c6e90faac2675aa89e2176d2eec7d8R128 RUN sh -c "echo 'deb http://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/1.18:/1.18.3/xUbuntu_20.04/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list" && \ curl -LO https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/1.18:/1.18.3/xUbuntu_20.04/Release.key && \ - apt-key add - < Release.key && apt-get update && \ - apt-get install -y --no-install-recommends cri-o=1.18.3~3 + apt-key add - < Release.key && \ + clean-install cri-o=1.18.3~3 # install podman RUN sh -c "echo 'deb https://dl.bintray.com/afbjorklund/podman focal main' > /etc/apt/sources.list.d/podman.list" && \ curl -L https://bintray.com/user/downloadSubjectPublicKey?username=afbjorklund -o afbjorklund-public.key.asc && \ - apt-key add - < afbjorklund-public.key.asc && apt-get update && \ - apt-get install -y --no-install-recommends podman=1.9.3~1 + apt-key add - < afbjorklund-public.key.asc && \ + clean-install podman=1.9.3~1 -RUN mkdir -p /usr/lib/cri-o-runc/sbin && cp /usr/local/sbin/runc /usr/lib/cri-o-runc/sbin/runc +RUN mkdir -p /usr/lib/cri-o-runc/sbin && cp /usr/sbin/runc /usr/lib/cri-o-runc/sbin/runc COPY entrypoint /usr/local/bin/entrypoint # automount service @@ -71,12 +87,7 @@ USER root # https://github.com/kubernetes-sigs/kind/blob/master/images/base/files/usr/local/bin/entrypoint RUN mkdir -p /kind # Deleting leftovers -RUN apt-get clean -y && rm -rf \ - /var/cache/debconf/* \ - /var/lib/apt/lists/* \ - /var/log/* \ - /tmp/* \ - /var/tmp/* \ +RUN rm -rf \ /usr/share/doc/* \ /usr/share/man/* \ /usr/share/local/* \