@@ -542,3 +542,65 @@ def _get_nginx_kwargs(os_version: OsVersion):
542542 )
543543 for os_version in (OsVersion .TUMBLEWEED ,)
544544]
545+
546+
547+ _PODMAN_FILES = {"podman-containers.conf" : "" , "containers.conf" : "" }
548+
549+ for fname in _PODMAN_FILES :
550+ _PODMAN_FILES [fname ] = (Path (__file__ ).parent / "podman" / fname ).read_text ()
551+
552+ _PODMAN_VERS_REGEX = "%%podman_version%%"
553+
554+ PODMAN_CONTAINERS = [
555+ ApplicationStackContainer (
556+ name = "podman" ,
557+ pretty_name = "Podman" ,
558+ license = "Apache-2.0" ,
559+ version_in_uid = False ,
560+ version = _PODMAN_VERS_REGEX ,
561+ replacements_via_service = [
562+ Replacement (
563+ regex_in_build_description = _PODMAN_VERS_REGEX , package_name = "podman"
564+ )
565+ ],
566+ os_version = os_version ,
567+ extra_files = _PODMAN_FILES ,
568+ is_latest = os_version in CAN_BE_LATEST_OS_VERSION ,
569+ package_list = ["podman" , "fuse-overlayfs" ],
570+ custom_end = r"""RUN useradd podman && \
571+ echo -e "podman:1:999\npodman:1001:64535" > /etc/subuid && \
572+ echo -e "podman:1:999\npodman:1001:64535" > /etc/subgid
573+
574+ COPY containers.conf /etc/containers/containers.conf
575+ COPY podman-containers.conf /home/podman/.config/containers/containers.conf
576+
577+ RUN mkdir -p /home/podman/.local/share/containers && \
578+ chown podman:podman -R /home/podman && \
579+ chmod 0644 /etc/containers/containers.conf
580+
581+ # Copy & modify the defaults to provide reference if runtime changes needed.
582+ # Changes here are required for running with fuse-overlay storage inside container.
583+ RUN sed -e 's|^#mount_program|mount_program|g' \
584+ -e '/additionalimage.*/a "/var/lib/shared",' \
585+ -e 's|^mountopt[[:space:]]*=.*$|mountopt = "nodev,fsync=0"|g' \
586+ /usr/share/containers/storage.conf \
587+ > /etc/containers/storage.conf
588+
589+ VOLUME /var/lib/containers
590+ VOLUME /home/podman/.local/share/containers
591+
592+ RUN mkdir -p /var/lib/shared/overlay-images \
593+ /var/lib/shared/overlay-layers \
594+ /var/lib/shared/vfs-images \
595+ /var/lib/shared/vfs-layers && \
596+ touch /var/lib/shared/overlay-images/images.lock && \
597+ touch /var/lib/shared/overlay-layers/layers.lock && \
598+ touch /var/lib/shared/vfs-images/images.lock && \
599+ touch /var/lib/shared/vfs-layers/layers.lock
600+
601+ ENV _CONTAINERS_USERNS_CONFIGURED="" \
602+ BUILDAH_ISOLATION=chroot
603+ """ ,
604+ )
605+ for os_version in ALL_NONBASE_OS_VERSIONS
606+ ]
0 commit comments