From 781733f69798d6a08cba6924667f0bc1dd936baf Mon Sep 17 00:00:00 2001 From: itmodulo Date: Sun, 16 Mar 2025 13:29:47 +0100 Subject: [PATCH] Add current work --- Dockerfile | 35 +++++++++++++++++++++++++++++++++++ README.md | 2 ++ containers-user.conf | 3 +++ containers.conf | 13 +++++++++++++ 4 files changed, 53 insertions(+) create mode 100644 Dockerfile create mode 100644 containers-user.conf create mode 100644 containers.conf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e80e7dd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,35 @@ +FROM docker.io/alpine:latest +COPY ./containers.conf /containers.conf +COPY ./containers-user.conf /containers-user.conf +RUN sed -i 's|dl-cdn\.alpinelinux\.org/alpine|alpine.sakamoto.pl/alpine|g' /etc/apk/repositories &&\ + apk add --no-cache podman git bash curl tree fuse-overlayfs openssh-client-default ucpp &&\ + ln -s /usr/bin/ucpp /usr/local/bin/ucpp &&\ + adduser -D podman -u 1000 &&\ + echo 'podman:1:999' > /etc/subuid &&\ + echo 'podman:1001:64535' >> /etc/subuid &&\ + cp /etc/subuid /etc/subguid &&\ + ln -s /usr/local/bin/podman /usr/bin/docker &&\ + mkdir -p /home/podman/.config/containers &&\ + mkdir -p /home/podman/.local/share/containers &&\ + mv /containers.conf /etc/containers/containers.conf &&\ + mv /containers-user.conf /home/podman/.config/containers/containers.conf &&\ + chown podman:podman -R /home/podman &&\ + chmod 644 /etc/containers/containers.conf &&\ + sed -e 's|^#mount_program|mount_program|g' \ + -e '/additionalimage.*/a "/var/lib/shared",' \ + -e 's|^mountopt[[:space:]]*=.*$|mountopt = "nodev,fsync=0"|g' \ + /usr/share/containers/storage.conf > /etc/containers/storage.conf &&\ + printf '/run/secrets/etc-pki-entitlement:/run/secrets/etc-pki-entitlement\n/run/secrets/rhsm:/run/secrets/rhsm\n' > /etc/containers/mounts.conf &&\ + 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 \ + /var/lib/shared/overlay-layers/layers.lock \ + /var/lib/shared/vfs-images/images.lock \ + /var/lib/shared/vfs-layers/layers.lock \ + +ENV _CONTAINERS_USERNS_CONFIGURED="" BUILDAH_ISOLATION="chroot" +VOLUME /var/lib/containers/storage +VOLUME /home/podman/.local/share/containers +ENTRYPOINT [ "/bin/bash" ] diff --git a/README.md b/README.md index 40b9924..6b31753 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # podman-alpine +Alpine adopted image for building containers inside docker container without dind or pinp + diff --git a/containers-user.conf b/containers-user.conf new file mode 100644 index 0000000..2404c47 --- /dev/null +++ b/containers-user.conf @@ -0,0 +1,3 @@ +[containers] +volumes = [ "/proc:/proc" , ] +default_sysctls = [] diff --git a/containers.conf b/containers.conf new file mode 100644 index 0000000..19278ed --- /dev/null +++ b/containers.conf @@ -0,0 +1,13 @@ +[containers] +netns="host" +userns="host" +ipcns="host" +utsns="host" +cgroupns="host" +cgroups="disabled" +log_driver="k8s-file" + +[engine] +cgroup_manager="cgroupfs" +events_logger="file" +runtime="crun"