From 530203856efba5f21f6865bb929702b3e290863b Mon Sep 17 00:00:00 2001 From: Zack Cerza Date: Wed, 3 Aug 2022 11:47:44 -0600 Subject: [PATCH] containers/testnode: Support nesting Signed-off-by: Zack Cerza --- containers/testnode/Dockerfile | 40 ++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/containers/testnode/Dockerfile b/containers/testnode/Dockerfile index 8a16657f57..07670ae37f 100644 --- a/containers/testnode/Dockerfile +++ b/containers/testnode/Dockerfile @@ -1,12 +1,44 @@ -FROM quay.io/centos/centos:stream9 +FROM quay.io/centos/centos:stream8 +RUN dnf -y update && \ + rpm --setcaps shadow-utils 2>/dev/null && \ + dnf -y install podman crun --exclude container-selinux && \ + dnf clean all && \ + rm -rf /var/cache /var/log/dnf* /var/log/yum* +RUN useradd podman; \ + echo podman:0:5000 > /etc/subuid; \ + echo podman:0:5000 > /etc/subgid; \ + echo root:0:65535 > /etc/subuid; \ + echo root:0:65535 > /etc/subgid; +RUN mkdir -p /root/.local/share/containers /home/podman/.local/share/containers +VOLUME /var/lib/containers +VOLUME /home/podman/.local/share/containers +VOLUME /root/.local/share/containers +ADD https://raw.githubusercontent.com/containers/libpod/master/contrib/podmanimage/stable/containers.conf /etc/containers/containers.conf +ADD https://raw.githubusercontent.com/containers/libpod/master/contrib/podmanimage/stable/podman-containers.conf /home/podman/.config/containers/containers.conf +ADD https://raw.githubusercontent.com/containers/podman/main/contrib/podmanimage/stable/podman-containers.conf /root/.config/containers/containers.conf +RUN chown podman:podman -R /home/podman; \ + echo 'podman:podman' | chpasswd +RUN chmod 644 /etc/containers/containers.conf; \ + sed -i \ + -e 's|^#mount_program|mount_program|g' \ + -e '/additionalimage.*/a "/var/lib/shared",' \ + -e 's|^mountopt[[:space:]]*=.*$|mountopt = "nodev,fsync=0"|g' \ + /etc/containers/storage.conf +RUN mkdir -p /var/lib/shared/overlay-images /var/lib/shared/overlay-layers /var/lib/shared/vfs-images /var/lib/shared/vfs-layers; \ + touch /var/lib/shared/overlay-images/images.lock; \ + touch /var/lib/shared/overlay-layers/layers.lock; \ + touch /var/lib/shared/vfs-images/images.lock; \ + touch /var/lib/shared/vfs-layers/layers.lock +ENV _CONTAINERS_USERNS_CONFIGURED="" + RUN dnf -y install \ sudo \ openssh-server \ hostname \ python3-pip \ - httpd \ - podman && \ - dnf clean all + httpd +RUN dnf clean all && \ + rm -rf /var/cache /var/log/dnf* /var/log/yum* COPY testnode_start.sh / COPY testnode_stop.sh / COPY testnode_sudoers /etc/sudoers.d/teuthology -- 2.39.5