33 lines
2.0 KiB
Docker
33 lines
2.0 KiB
Docker
# Debian-based podman daemon image for building docker images
|
|
# inside docker containers (e.g. gitlab runners).
|
|
#
|
|
# Yoinked with love from:
|
|
# https://www.redhat.com/sysadmin/podman-inside-container
|
|
|
|
FROM debian:12.5
|
|
|
|
RUN apt-get -y update
|
|
|
|
RUN apt-get -y install make podman podman-compose fuse-overlayfs
|
|
|
|
RUN useradd podman; \
|
|
echo podman:10000:5000 > /etc/subuid; \
|
|
echo podman:10000:5000 > /etc/subgid;
|
|
|
|
VOLUME /var/lib/containers
|
|
VOLUME /home/podman/.local/share/containers
|
|
|
|
ADD https://raw.githubusercontent.com/containers/image_build/main/podman/containers.conf /etc/containers/containers.conf
|
|
ADD https://raw.githubusercontent.com/containers/image_build/main/podman/podman-containers.conf /home/podman/.config/containers/containers.conf
|
|
|
|
RUN chown podman:podman -R /home/podman
|
|
|
|
# chmod containers.conf and adjust storage.conf to enable Fuse storage.
|
|
# 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/containers.conf
|
|
# RUN echo -e '[storage]\ndriver="zfs"\nmount_program="zfs"\nadditionalimage=/var/lib/shared\nmountopt="nodev,fsync=0"' >> /etc/containers/containers.conf
|
|
RUN chmod 644 /etc/containers/containers.conf
|
|
RUN echo '[storage]\ndriver="overlay"\n[storage.options.overlay]\nforce_mask="private"\nmount_program="/usr/bin/fuse-overlayfs"\nmountopt="nodev"' >> /etc/containers/containers.conf
|
|
RUN mkdir -p /root/.config/containers/ && echo '[storage]\ndriver="overlay"\n[storage.options.overlay]\nforce_mask="private"\nmount_program="/usr/bin/fuse-overlayfs"\nmountopt="nodev"' > /root/.config/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="" |