Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kic base image: install stable containerd and clean up packages #9135

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 28 additions & 18 deletions deploy/kicbase/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,54 @@ 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/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
Expand Down Expand Up @@ -71,12 +86,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/* \
Expand Down