github.com/hanks177/podman/v4@v4.1.3-0.20220613032544-16d90015bc83/contrib/podmanimage/testing/Containerfile (about) 1 # testing/Containerfile 2 # 3 # Build a Podman container image from the latest 4 # stable version of Podman on the Fedoras Updates System. 5 # https://bodhi.fedoraproject.org/updates/?search=podman 6 # This image can be used to create a secured container 7 # that runs safely with privileges within the container. 8 # 9 FROM registry.fedoraproject.org/fedora:latest 10 11 # Don't include container-selinux and remove 12 # directories used by dnf that are just taking 13 # up space. 14 RUN dnf -y update && \ 15 rpm --setcaps shadow-utils 2>/dev/null && \ 16 dnf -y install podman fuse-overlayfs \ 17 --exclude container-selinux --enablerepo updates-testing && \ 18 dnf clean all && \ 19 rm -rf /var/cache /var/log/dnf* /var/log/yum.* 20 21 RUN useradd podman; \ 22 echo -e "podman:1:999\npodman:1001:64535" > /etc/subuid; \ 23 echo -e "podman:1:999\npodman:1001:64535" > /etc/subgid; 24 25 ARG _REPO_URL="https://raw.githubusercontent.com/containers/podman/main/contrib/podmanimage/stable" 26 ADD $_REPO_URL/containers.conf /etc/containers/containers.conf 27 ADD $_REPO_URL/podman-containers.conf /home/podman/.config/containers/containers.conf 28 29 RUN mkdir -p /home/podman/.local/share/containers && \ 30 chown podman:podman -R /home/podman 31 32 # Copy & modify the defaults to provide reference if runtime changes needed. 33 # Changes here are required for running with fuse-overlay storage inside container. 34 RUN sed -e 's|^#mount_program|mount_program|g' \ 35 -e '/additionalimage.*/a "/var/lib/shared",' \ 36 -e 's|^mountopt[[:space:]]*=.*$|mountopt = "nodev,fsync=0"|g' \ 37 /usr/share/containers/storage.conf \ 38 > /etc/containers/storage.conf 39 40 # Note VOLUME options must always happen after the chown call above 41 # RUN commands can not modify existing volumes 42 VOLUME /var/lib/containers 43 VOLUME /home/podman/.local/share/containers 44 45 # chmod containers.conf and adjust storage.conf to enable Fuse storage. 46 RUN chmod 644 /etc/containers/containers.conf && \ 47 sed -i -e 's|^#mount_program|mount_program|g' \ 48 -e '/additionalimage.*/a "/var/lib/shared",' \ 49 -e 's|^mountopt[[:space:]]*=.*$|mountopt = "nodev,fsync=0"|g' \ 50 /etc/containers/storage.conf 51 RUN mkdir -p /var/lib/shared/overlay-images \ 52 /var/lib/shared/overlay-layers \ 53 /var/lib/shared/vfs-images \ 54 /var/lib/shared/vfs-layers && \ 55 touch /var/lib/shared/overlay-images/images.lock && \ 56 touch /var/lib/shared/overlay-layers/layers.lock && \ 57 touch /var/lib/shared/vfs-images/images.lock && \ 58 touch /var/lib/shared/vfs-layers/layers.lock 59 60 ENV _CONTAINERS_USERNS_CONFIGURED=""