Repository navigation
feat: add the podman-in-podman Feature 1.0.0 - #9
Conversation
The Feature runs a Podman engine in the dev container: rootless Podman for the remote user, rootful Podman through sudo. install.sh installs Podman and its tools from the distribution archive with no version pins. The entrypoint nests cgroup v2, makes the runtime directory, fits the subordinate IDs to the user namespace and starts the API socket for dockerCompat and docker-compose. The tests are the default test and nine scenarios. rootless_vscode_keepid also runs in the podman-host job under rootless Podman with keep-id.
- test-pr.yaml: the test, test-scenarios and podman-host jobs run on debian:sid, debian:trixie and ubuntu:noble. test-scenarios skips the duplicate test, which ran on ubuntu:focal. A new push stops the tests of the previous push. - test-all.yaml: test each Feature alone on debian:sid, then all Features together. - release.yaml: one publish run at a time. The permissions of release.yaml, test-pr.yaml and lint.yaml have comments. - lint.yaml: semver compares the versions, so 1.1.0 is higher than 1.1.0-rc.1. - README.md: 10 of the 12 checked upstream Features install.
- Set rootless_storage_path in /etc/containers/storage.conf, made from the file of the distribution. containers/storage 1.57 (trixie) and 1.51 (noble) read no storage.rootless.conf.d drop-in. - Make /var/lib/cni. Podman 4 (noble) otherwise mounts its private directory on /var/lib in the rootless network namespace, which hides the rootless storage, so user networks are not found. - Install iptables: netavark 1.4 (noble) runs iptables, not nft. - Install docker-compose-v2 where the archive has it. The docker-compose package of Ubuntu is Compose version 1, which imports distutils. - podman-subid-ranges.sh: keep each extent of the ID map separate. The kernel refuses a subordinate range across two extents, for example 1:1000 with vscode at uid 1001 under keep-id. - podman-init.sh: give the rootless storage to the user before 'podman system migrate', which writes to it. - Tests: check the pasta network mode with podman inspect (Podman 4.9 has no RootlessNetworkCmd in podman info), add the uid 1001 and cross-extent cases of the subid ranges, drop the config grep.
The Dev Containers CLI runs the Feature entrypoints after the container prints "Container started", and starts the tests then. The tests could read the state before podman-init.sh ended: a stale docker.sock link, no API socket, no pid file. podman-init.sh now writes /run/podman-in-podman/ready at its end, and each test that needs the entrypoint waits for that file first.
|
Proof for head 201c441 (commits 3ae766e and 201c441 on top of f97341f). CI, run 44557802961 (test-pr.yaml) on ubuntu-26.04 runners
lint (run 44557802936) and validate (run 44557802947) pass. The one failed check on sid and trixie is This is the AppArmor conflict of the runner host (Ubuntu 26.04: the Causes of the failures on f97341f (run 44545587490) and their fixes
Local runs in the owner's devcontainer (Docker engine inside the keep-id user namespace) The local noble and trixie scenario runs used the tree of 3ae766e, and the local noble default test an earlier state of that commit. 201c441 only adds the ready file. CI covers each image on 201c441. Red step of the new subid cases (podman-subid-ranges.sh before the fix): After the fix: |
…ket and no Docker CLI Remove compose=docker-compose and its packages. dockerCompat installs podman-docker, starts a rootful Podman API service on /run/podman/podman.sock (root:docker 0660) and links /var/run/docker.sock to it. podman-compose is the only compose provider. Move the shared install steps to scripts/podman-common.sh, add the podman-check.sh postStartCommand, the exclusion of podman-outside-podman, slirp4netns, and the docker_compat scenario and restart checks.
|
Proof for head 3debd5d (the change to the contract of 2026-11-19: no Docker CLI, rootful API socket, podman-compose as the only compose provider). CI on 3debd5d: all 12 checks pass.
Local runs in the devcontainer (Docker engine in the keep-id user namespace), Dev Containers CLI 0.90.0 from package-lock.json: Selected output of the local runs:
Other commands: Not proven here: name resolution on debian:sid in the local run, because the local host user has almost no free inotify watches (see NOTES.md, Limits). CI proves it on the runner. |
… set netavark On ubuntu:noble, the start line of podman-check.sh had a Podman warning in place of the version, over two lines. The check put the stderr of podman into the version text. - podman-check.sh writes the stderr of podman to a temporary file. Only stdout goes into the start line. The last stderr line goes into the failure line. - The containers.conf drop-in sets network_backend = "netavark". The podman package of ubuntu:noble has /etc/cni/net.d/87-podman-bridge.conflist, and the Feature installs no CNI plugins. With no backend set, Podman 4.9 reads that file on a new store and warns, and it selects CNI on a store that has images but no defaultNetworkBackend file. Then 'podman run' fails. - test.sh checks one start line on a store with no backend file, and netavark on a store with images and no backend file. - NOTES.md and README.md tell about the backend.
|
Proof for head 4e2ef41 (fix of the review point: a Podman warning in the start line of The cause, confirmed:
The fix:
Test first (local, Dev Containers CLI 0.90.0): Start lines of these runs:
Local note: the warning itself did not occur in the local Docker engine (the CNI file loads there with no validation warning), so the local red step is the netavark check. CI job 135833753963 shows the warning on the runner. Other commands: CI on 4e2ef41: all 12 checks pass (PR - Test Updated Features run 44606406929, Lint run 44606406975, Validate run 44606406984).
|
|
Proof for head 4e2ef41, continuation: no new commit. Review of the head against each "Change" line of the issue section "Shared implementation with podman-outside-podman": commits 3debd5d and 4e2ef41 cover all of them (options, An earlier stopped run left one uncommitted edit: a check "vscode in the group docker" in Name resolution on debian:sid, measured locally on a host with free inotify watches (Dev Containers CLI from package-lock.json): CI of 4e2ef41: all 12 checks pass. In |
Fixes of the review of PR #9. - Under Docker, /run is not a tmpfs, so the ready file of the last start stays after a stop and a start. podman-check.sh accepted it before the entrypoint of this start ran. podman-init.sh now writes the start time of PID 1 (field 22 of /proc/1/stat) to the ready file. podman-check.sh waits until the file holds the start time of the current PID 1. - In dash, the input redirection of the PID check came before 2> /dev/null, so a missing /proc/<pid>/cmdline printed an error line at the start after a restart. The stderr redirection now comes first. - idempotent.sh writes a ready file of an earlier start and checks that podman-check.sh waits until the entrypoint runs, and then passes. - The compose services of compose_podman.sh and docker_compat.sh use init: true. As PID 1, sleep ignores SIGTERM, so each down waited 10 seconds for each container. - NOTES.md and README.md tell about the start time in the ready file.
|
Proof for head 3ee9cce (fixes of the 4 minor points of the independent review of 4e2ef41). 1. Ready file of an earlier start. 2. dash error line. The PID check now puts In the idempotent scenario, the run after SIGKILL printed 3. Compose stop time. The services of CI 4. CI jobs. No workflow change. The shared Local runs (Dev Containers CLI 0.90.0 from package-lock.json, scenarios.json with the base image in place of debian:sid):
CI of 3ee9cce: 12 of 12 check runs pass (run 44615553566 for test-pr.yaml). In The PR stays a draft. |
Add the podman-in-podman Feature 1.0.0. It runs a Podman engine in the dev container: the remote user runs rootless Podman, and sudo runs rootful Podman. It works under a Docker outer engine and under rootless Podman with
--userns=keep-id, so the devops-cli dev container can stop using docker-in-docker and the/etc/os-releaserewrite. Podman replaces Docker: the Feature installs no Docker CLI and no Docker engine package, and adockercommand runs Podman.Feature (
src/podman-in-podman):install.shinstalls Podman and its tools from the distribution archive with no version pins, and buildah, skopeo and podman-compose per option. The package list namesaardvark-dnsandca-certificates(--no-install-recommendsdrops them),iptables(netavark 1.4 on ubuntu:noble runs iptables) andslirp4netns(Podman 4.9 on ubuntu:noble starts the rootless network namespace of a user network with it, and a later install does not repair a failed first run).scripts/podman-common.shholds the install steps that podman-outside-podman (feat(podman-outside-podman): add the podman-outside-podman Feature 1.0.0 #6) will keep as a byte-identical copy: the root and apt-get checks, the remote user rule of devcontainers/features, the exclusion of podman-outside-podman, thedockerCompatskip, thepodman-dockerinstall, the groupdocker, and the podman-compose install with its compose file. The file defines only functions.composeispodman-compose(default) ornone./etc/containers/containers.conf.d/50-podman-in-podman-compose.confmakes podman-compose the only compose provider, sopodman compose,docker composeandpodman-composeall run podman-compose with no API service.dockerCompatinstallspodman-docker.dockerruns rootless Podman for the remote user and rootful Podman with sudo. The entrypoint starts a rootfulpodman system service --time=0 unix:///run/podman/podman.sock, sets the socket toroot:docker 0660and links/var/run/docker.sockto it, as dockerd of docker-in-docker does. The install makes the system groupdockerand adds the remote user. When/usr/local/share/docker-init.shexists, or adockercommand on the PATH is not frompodman-docker, the install skipsdockerCompatwith one(!)line.podman-init.shmakes/shared, nests cgroup v2 before any podman command, makes/run/user/<uid>, gives the rootless storage to the user, and fits the subordinate IDs to the user namespace (podman-subid-ranges.sh). The API service runs only when the PID file names a live process whose/proc/<pid>/cmdlineispodman system service. Before a start, the entrypoint removes the old socket and PID file, then waits for the new socket. All runtime files (ready, PID file, service log) are in/run/podman-in-podman/. At the end, the entrypoint writes the start time of PID 1 (field 22 of/proc/1/stat) toready. This value is new at each start of the container. A second run changes nothing.postStartCommand/usr/local/share/podman-check.shruns as the remote user. It waits up to 60 seconds untilreadyholds the start time of the current PID 1, so it does not accept thereadyfile of an earlier start (under Docker,/runis not a tmpfs). It runspodman info, and withdockerCompatalsopodman --url unix:///var/run/docker.sock info. Only stdout of podman goes into the start line. On failure, it prints(!) podman-in-podman:with the last stderr line and the log path, and exits 1./var/lib/containers-rootless/<user>.installsAfteris common-utils, docker-in-docker and docker-outside-of-docker. NocontainerEnv.NOTES.mdhas the sections Use, Security, Start of the container, Docker compatibility, Storage, Limits and OS support. Docker compatibility names the two stores,podman save <image> | sudo podman load, and theDOCKER_HOSTof the profile.d files ofpodman-docker. Limits names the AppArmor pasta profile of Ubuntu 26.04 hosts and the aardvark-dns inotify watch on debian:sid.Changes from the first issue text, with the evidence:
rootless_storage_pathgoes in/etc/containers/storage.conf, made from/usr/share/containers/storage.conf. containers/storage 1.57 (trixie) and 1.51 (noble) read nostorage.rootless.conf.d/directory.install.shmakes/var/lib/cni. In its rootless network namespace, Podman 4.9 mounts a private directory on/var/lib/cni, or on/var/libwhen/var/lib/cniis absent, and the mount on/var/libhid the rootless storage on noble.podman-subid-ranges.shkeeps each extent of the ID map separate. The kernel refuses a subordinate range across two extents. On noble, vscode gets uid 1001, and the ranges are1:999,1000:1and1002:64534.network_backend = "netavark". The podman package of ubuntu:noble has/etc/cni/net.d/87-podman-bridge.conflist, and the Feature installs no CNI plugins. With no backend set, Podman 4.9 reads that file on a new store and puts a warning on stderr, and it selects CNI on a store that has images but nodefaultNetworkBackendfile. Thenpodman runfails withfailed to find plugin "bridge".podman inspect, becausepodman infoof Podman 4.9 has noRootlessNetworkCmd.compose=docker-compose, the Docker Compose packages and the rootless API service. On the ubuntu-26.04 runner,docker compose downthrough the rootless service failed withrootless netns: kill network process: permission denied: the pasta AppArmor profile of the host refuses the signal of podman (Debian bug 1100135). The rootful service uses no pasta. CI changes nothing on the runner for AppArmor.kernel.apparmor_restrict_unprivileged_userns=0, so this PR does not set the sysctl.podman-in-podmanjob and skipped the shared steps for it. This PR keeps the sharedtest,test-scenariosandpodman-hostjobs of chore: reset the repository to the Dev Container Features format #3 (a new Feature needs no workflow edit) and gives them the three-image matrix, so the default test and all 9 scenarios run on the three images for each Feature, with no duplicate run.Tests: the default test and 9 scenarios (
rootless_vscode_keepid,rootful_limits,build,compose_podman,docker_compat,minimal,with_docker_in_docker,subid_ranges,idempotent) on debian:sid, debian:trixie and ubuntu:noble, linux/amd64 only. Each test starts withcheck "podman-check" /usr/local/share/podman-check.sh. Name resolution is checked with the exit status of<compose> exec -T b ping -c1 -W5 a, and compose up and down are checked by the state of the containers.idempotentalso kills the API service with SIGKILL, runs the entrypoint again, and checks the newroot:docker 660socket as vscode. Then it writes areadyfile of an earlier start and checks thatpodman-check.shwaits until the entrypoint runs, and then passes. The compose services useinit: true, sodowndoes not wait 10 seconds for eachsleepcontainer. The test job installs the Feature next to/usr/local/share/podman-outside-podmanand expects the stop with its message. The scenario job finds thedockerCompat is skipped.line in the build log ofwith_docker_in_docker.Workflow points from the review of PR #4:
test-scenariosskips the duplicate test, which ran on ubuntu:focal.test-alltests each Feature alone, then all Features together.release.yamlruns one publish at a time. The permissions have comments (zizmor pedantic).lint.yamlcompares versions with semver (new dev dependency), so 1.1.0 is higher than 1.1.0-rc.1.README.md: 10 of the 12 checked upstream Features install.Closes #5