Repository navigation
Description
Goal
Run a full Podman engine inside the dev container. Rootless use by the remote user is the default. Rootful use goes through sudo. The Feature works under a Docker outer engine (GitHub runner, the containerized Docker engine) and under rootless Podman with --userns=keep-id (the owner's WSL2 host). It replaces docker-in-docker in the owner's devcontainer, so the /etc/os-release rewrite can go. The owner asked for it.
Why no open Feature: devcontainers/features has no podman Feature (git ls-tree upstream/main src). containers.dev/features lists one podman entry, devcontainers-extra podman-homebrew:1 v1.0.21. It installs Homebrew's podman with only a version option and has no privileged, mounts, entrypoint or subuid setup, so it cannot run nested containers. NerdIT-Tech podman-remote v0.1.0 is a client-only design, and the other related Features only install buildah or skopeo with apt. Open tools first: the open tools are Debian's podman packages and the containers/image_build configuration layout. This Feature only connects them in the official Feature format. The owner asked for it by name.
Change
Scope: src/podman-in-podman/{devcontainer-feature.json, install.sh, NOTES.md, generated README.md}. test/podman-in-podman/{test.sh, scenarios.json, one .sh per scenario, subid fixture maps}. One filter line in test-pr.yaml and one README row. Content as below.
Decisions (owner, 2026-11-19): keep the Feature ID podman-in-podman. Podman and its tools come from the distribution archive (sid apt on debian:sid) with no version pins. The tests run on debian:sid, debian:trixie and ubuntu:noble, linux/amd64 only. The defaults stay compose=podman-compose and dockerCompat=false; the devops-cli devcontainer sets only dockerCompat: true (owner, 2026-11-19 later: no Docker CLI; Podman replaces Docker; the value docker-compose no longer exists).
Options
| Option | Type | Default | Description |
|---|---|---|---|
buildah |
boolean | true |
Install buildah from the distribution archive. |
skopeo |
boolean | true |
Install skopeo from the distribution archive. |
compose |
string (enum: podman-compose, docker-compose, none) | podman-compose |
Compose tool. podman-compose works with no API service. docker-compose needs the API socket, so this value also starts the rootless socket service at container start. The study proposed docker-compose as the default, but its verified evidence shows that rootless docker-compose fails when no service runs, and that podman-compose 1.6.0 works without one. So the default is podman-compose. |
dockerCompat |
boolean | false |
Install podman-docker (the /usr/bin/docker shim) and touch /etc/containers/nodocker. At start, run podman system service --time=0 as the remote user on /run/user//podman/podman.sock and link /var/run/docker.sock to it. podman-docker Conflicts with docker-ce-cli, docker-cli and docker.io. When a different package already owns /usr/bin/docker (for example docker-in-docker), install.sh prints a message, skips this option and does not fail. podman-docker ships a tmpfiles.d link, but systemd-tmpfiles does not run in a dev container, so the entrypoint makes the link. |
Metadata (devcontainer-feature.json)
{
"id": "podman-in-podman",
"version": "1.0.0",
"name": "Podman in Podman",
"documentationURL": "https://github.com/dan-petty/devcontainer-features/tree/main/src/podman-in-podman",
"privileged": true,
"entrypoint": "/usr/local/share/podman-init.sh",
"mounts": [
{
"source": "podman-var-lib-containers-${devcontainerId}",
"target": "/var/lib/containers",
"type": "volume"
},
{
"source": "podman-rootless-${devcontainerId}",
"target": "/var/lib/containers-rootless",
"type": "volume"
}
],
"installsAfter": [
"ghcr.io/devcontainers/features/common-utils",
"ghcr.io/devcontainers/features/docker-in-docker"
]
}Not set: capAdd, securityOpt, init, containerEnv, dependsOn, customizations. Reasons: (1) privileged true is the same as docker-in-docker (upstream devcontainer-feature.json:78). Without it, rootless nesting needed CAP_SYS_ADMIN, seccomp=unconfined, a storage volume and a /dev/net/tun bind. A Feature cannot declare devices or runArgs. Privileged adds no privilege to the owner's devcontainer, which docker-in-docker already makes privileged (Seccomp 0). The README must still say that it removes seccomp and gives all capabilities. (2) The two volumes keep storage off the overlayfs root, so rootless storage uses native overlay with no /dev/fuse. They also keep rootless storage off the shared home volume global-devcontainer-home (.devcontainer/devcontainer.json:7). The mount target cannot depend on the user name, so the rootless volume has a fixed path. (3) No containerEnv: CONTAINER_HOST would force remote mode (podman.1.md:286). (4) The tool cannot declare that this Feature excludes podman-outside-podman, so podman-outside-podman's install.sh checks for it (see that Feature).
install.sh and the entrypoint
install.sh runs as root at image build:
set -e. Stop if not root. Stop with a clear message if apt-get is absent (Debian and Ubuntu only). Read BUILDAH, SKOPEO, COMPOSE and DOCKERCOMPAT as VAR="${OPTION:-default}". Take USERNAME from _REMOTE_USER, with the upstream 'automatic' fallback (the user with uid 1000, else root). Do not read VERSION_ID or VERSION_CODENAME.- Make the marker directory /usr/local/share/podman-in-podman/.
rm -rf /var/lib/apt/lists/*,apt-get update, thenapt-get install -y --no-install-recommends podman crun conmon netavark aardvark-dns nftables passt uidmap catatonit containers-storage golang-github-containers-common fuse-overlayfs, plus buildah and skopeo per option, plus podman-compose or docker-compose per option. The list adds nftables to the study's list. Without nftables, rootful bridge runs fail with 'netavark: nftables error: unable to execute "nft"'. aardvark-dns must be named because --no-install-recommends drops it, and without it names on user networks do not resolve. Skip criu, gvproxy and slirp4netns: pasta is the rootless default in Podman 5. Use no version pins: versions float with the base distribution.- If DOCKERCOMPAT is true: when /usr/bin/docker exists and
dpkg -S /usr/bin/dockerdoes not name podman-docker, print '(!) A docker CLI is present; dockerCompat is skipped' and continue. Otherwise install podman-docker and touch /etc/containers/nodocker. - Write /etc/containers/containers.conf.d/50-podman-in-podman.conf with [engine] cgroup_manager="cgroupfs" and events_logger="file". Podman already falls back to these values, so this file only makes the choice fixed. Do not copy the netns/userns/ipcns/utsns/cgroupns="host" or cgroups="disabled" lines of quay.io/podman/stable. They break -p publishing, per-container networks and limits.
- Write /etc/containers/storage.rootless.conf.d/50-podman-in-podman.conf with [storage] rootless_storage_path="/var/lib/containers-rootless/". Use the user name from install time, which is the form the verdict tested. Make /var/lib/containers-rootless/ owned by the user, so a new volume gets it at first mount.
- Install /usr/local/share/podman-init.sh (the entrypoint) and /usr/local/share/podman-subid-ranges.sh. The second script is a small command: given a uid and a uid_map file (default /proc/self/uid_map), it prints the subordinate ranges. Write the remote user and the socket choice (dockerCompat, or compose=docker-compose) into /usr/local/share/podman-in-podman/config.
- Clear the apt lists.
The entrypoint /usr/local/share/podman-init.sh runs at every start, as root (through sudo when the container user is not root). It is idempotent and ends with exec "$@". Order matters: step b must run before any podman call. If podman runs first, the root cgroup becomes 'domain threaded' and +memory cannot be enabled.
- a.
mount --make-rshared /(moby hack/dind:83). Without it, rootless podman prints a '"/" is not a shared mount' warning. - b. cgroup v2 nesting as in docker-init.sh (upstream docker-in-docker install.sh:1048-1077): move every PID to /sys/fs/cgroup/init, with a retry, then enable each controller in cgroup.subtree_control. A second run after docker-in-docker's run is a no-op. Do not mount tmpfs on /tmp, because the owner mounts a volume there (.devcontainer/devcontainer.json:5).
- c. Make /run/user mode 0755 and /run/user/ mode 0700, owned by the user. Rootful podman otherwise leaves /run/user at 0700 root, and rootless podman then fails with 'lstat /run/user/1000: permission denied'.
- d. Subordinate IDs: if the user's /etc/subuid and /etc/subgid ranges lie inside /proc/self/uid_map and gid_map, keep them. Otherwise, write the mapped ranges without 0 and without the user's own ID. Under keep-id this gives 1:999 and 1001:64535, the same split as quay.io/podman/stable Containerfile:95-96. In the init user namespace of a GitHub runner, the useradd default 100000:65536 stays. When the file changed, run
runuser -u <user> -- podman system migrate. - e. Make /var/lib/containers-rootless/ owned by the user (the volume can be new).
- f. If the config asks for the socket: start
podman system service --time=0 unix:///run/user/<uid>/podman/podman.sockas the user with XDG_RUNTIME_DIR=/run/user/, detached. If dockerCompat is active, link /var/run/docker.sock to that socket. - g. exec "$@".
The Feature needs no group, because Podman has no daemon.
Tests
Base images (owner decision of 2026-11-19): debian:sid, debian:trixie and ubuntu:noble, linux/amd64 only. Each test runs on all three. Each scenario uses common-utils:2 with user vscode where a non-root user is needed.
test/podman-in-podman/test.sh (default options, runs as root, so rootful): podman, buildah, skopeo and podman-compose exist; docker-compose and podman-docker are absent; both drop-ins exist; podman info reports cgroups v2, netavark, crun and cgroupfs; podman run --rm quay.io/podman/hello works (this also proves pull and egress); stderr has no 'Failed to add conmon to cgroupfs sandbox cgroup' line.
test/podman-in-podman/scenarios.json (JSONC):
- rootless_vscode: remoteUser vscode. The run works over pasta. GraphRoot is /var/lib/containers-rootless/vscode with 'Native Overlay Diff: true'. /run/user/1000 is 0700 vscode. Each vscode line in /etc/subuid lies inside /proc/self/uid_map.
- rootful_limits:
sudo podman run --memory 64m --cpus 0.5prints memory.max 67108864 and cpu.max '50000 100000'. The bridge address is in 10.88.0.0/16. - build: rootless and rootful
podman buildwithRUN adduser -u 2000and chown gives owner 2000 with default isolation. - compose_podman: two services resolve each other by name through aardvark-dns, and no API service runs.
- compose_docker: compose=docker-compose with dockerCompat=true.
docker versionshows a Podman server, /var/run/docker.sock is a link, anddocker compose upworks with name resolution. - minimal: buildah=false, skopeo=false, compose=none. Those binaries are absent and podman still works.
- with_docker_in_docker: build.dockerfile FROM debian:sid with the owner's current os-release rewrite, plus docker-in-docker:4 (moby false) and this Feature with dockerCompat=true. dockerCompat is skipped with its message. dockerd works. Rootless podman egress works.
sudo podman run --network hostworks. Rootful bridge egress fails under Docker's FORWARD DROP. The README documents this, and the test does not assert the failure. - subid_ranges: runs /usr/local/share/podman-subid-ranges.sh against fixture map files. The keep-id map '0 1 1000 / 1000 0 1 / 1001 1001 64536' gives 1:999 and 1001:64535. The map '0 0 4294967295' keeps the existing range.
- idempotent: a second
sudo /usr/local/share/podman-init.sh trueexits 0 and changes nothing.
CI jobs on ubuntu-latest: npm ci, then npx devcontainer features test for the default test and the scenarios. The test containers use the Docker engine in the init user namespace. A podman-host job puts a docker shim to the runner's Podman 4.9.3 first on PATH. The CLI then picks its podman variant and adds --userns=keep-id. This is the same code path as VS Code's dockerPath=podman. The job runs rootless_vscode under rootless Podman. Nobody has run this job yet.
Local proof: npx devcontainer features test -f podman-in-podman -i debian:sid . in the owner's devcontainer. Its Docker engine runs inside the keep-id user namespace, so the test containers see the keep-id uid_map. That is the setup of the design study.
What CI cannot prove: the real WSL2 rootless Podman 5.7 outer engine with VS Code (only the local run and the shim job come near it). Also not proven: the controllers that WSL delegates, arm64, and rootless limits. Rootless runs on ubuntu-24.04 may hit kernel.apparmor_restrict_unprivileged_userns.
AppArmor on the runner. Owner decision of 2026-11-19: if the rootless scenario fails on kernel.apparmor_restrict_unprivileged_userns, the rootless podman test job (only that job) may run sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 on the ephemeral GitHub runner. Record it in the README of this repository. Do not change any other job or setting to make a test pass.
README (NOTES.md). Say that privileged: true removes seccomp and gives all capabilities. Say that rootful bridge egress fails next to docker-in-docker (Docker sets FORWARD DROP), that rootless --memory is ignored, and that WSL2 delegates only the cpu, memory and pids controllers.
Later. minikube stays in the devtools image. Its podman driver is not tested, so a minikube --driver=podman scenario is a later item.
Risk. sid packages float, so an upgrade in sid can change config keys or defaults with no commit here; only the weekly test-all run catches it. The entrypoint writes /etc/subuid and /etc/subgid again when the outer user namespace changes, and a rootless store made under the old map can then need podman system reset. Tests pull quay.io/podman/hello, so a registry outage fails a test with no fault in the Feature. arm64 is not a target.
Workflow points from the review of PR #4 (this PR runs the test jobs with a Feature first)
test-pr.yamltest-scenarios job: the CLI default base image is ubuntu:focal, so aduplicate.shtest runs on focal. Give the job--skip-duplicated(the test job already runs the duplicate test on debian:sid), and the same in CONTRIBUTING.md.test-all.yaml: test each Feature alone on debian:sid as well as together, so a Feature that needs a package of another Feature fails, and podman-in-podman with podman-outside-podman does not fail only in the combined test. Fix the comment at :26-28.release.yaml: add a concurrency group (no parallel publish runs), and document the permissions of release.yaml and test-pr.yaml (zizmor pedantic: concurrency-limits, undocumented-permissions).lint.yamlversion check:sort -Vputs 1.1.0-rc.1 after 1.1.0. Use a semver compare, so a release after a pre-release passes.- README.md:7: the counts of the sid census must agree (installed, refused, listed).
Owner decision of 2026-11-19: the docker socket is rootful, as in docker-in-docker
On the ubuntu-26.04 runner, docker compose down through the rootless API service fails with "rootless netns: kill network process: permission denied": the host AppArmor profile of pasta refuses the SIGTERM of podman (Debian bug 1100135, Launchpad 2154379). The same happens on any Ubuntu host with AppArmor. devcontainers/features docker-in-docker never meets it: its entrypoint (moby hack/dind) starts a rootful dockerd in the privileged container, so there is no pasta, and its CI changes nothing on the runner.
- With
dockerCompatorcompose=docker-compose, the entrypoint starts a rootful Podman API service (podman system service, as root) and links/var/run/docker.sockto its socket. The remote user reaches the socket through a group (as thedockergroup of docker-in-docker). Socket access gives root in the container, the same as docker-in-docker. - Direct
podmanuse by the remote user stays rootless, and rootful use without the socket still goes through sudo. - CI changes nothing on the runner for AppArmor. The README names the host bug for rootless use on AppArmor hosts.
Shared implementation with podman-outside-podman
podman-in-podman and podman-outside-podman (#6) follow one contract, as docker-in-docker and docker-outside-of-docker do upstream. These rules apply to podman-in-podman. Where they differ from the text above, these rules apply. "Change" marks a change to PR #9.
Owner rule of 2026-11-19: Podman replaces Docker. Neither Feature installs the Docker CLI (docker-cli, docker.io, docker-ce-cli) or a Docker engine package. A docker command runs Podman. /var/run/docker.sock is a Podman API socket.
Options
dockerCompat(boolean, defaultfalse) installspodman-docker. At container start, it also starts the rootful API service and makes the/var/run/docker.socklink. podman-outside-podman has the same option.- Change:
composetakespodman-composeornone. The default ispodman-compose. Remove the valuedocker-compose. podman-outside-podman has the same values. An enum withnoneis the form ofdockerDashComposeVersionin docker-in-docker. buildahandskopeostay in this Feature only. They use local storage, not the API.
The docker command
dockerCompatrunsapt-get install -y --no-install-recommends podman-dockeron all images. The/usr/bin/dockerof the package runsexec /usr/bin/podman "$@".- Keep
touch /etc/containers/nodocker. It stops the message "Emulate Docker CLI using podman". The shared function first runsmkdir -p /etc/containers. dockerruns rootless Podman for the remote user.sudo dockerruns rootful Podman. This is the same aspodmanandsudo podman.docker buildanddocker buildx buildrunpodman build(Buildah). The Feature installs no BuildKit and nodocker-buildx. NOTES.md needs no BuildKit text.- Change: skip
dockerCompatwhen/usr/local/share/docker-init.shexists. Also skip it when adockercommand is on the PATH anddpkg -Sdoes not namepodman-dockerfor that file. Then install no package, start no API service and make no link. Print one(!)line. PR feat: add the podman-in-podman Feature 1.0.0 #9 checks onlydpkg -S /usr/bin/docker. - Reason for the skip:
podman-dockerconflicts withdocker-cli,docker.ioanddocker-ce-cli.apt-get install -y podman-dockerremovesdocker-cli.
Compose
compose=podman-composeinstallspodman-compose. Change: it also runsmkdir -p /etc/containers/containers.conf.dand writes/etc/containers/containers.conf.d/50-podman-in-podman-compose.conf:[engine] compose_providers = ["podman-compose"] compose_warning_logs = false
- Then
docker compose,podman composeandpodman-composeall run podman-compose. podman-compose runs thepodmancommand and needs no API socket. As the remote user, it is rootless. - Reason for
compose_providers: when the image also has Docker Compose,podman composeselects Docker Compose first. It gives Docker Compose the rootless socket/run/user/<uid>/podman/podman.sockasDOCKER_HOST. No service runs there. Thusdocker compose upfails with "Cannot connect to the Docker daemon".compose_warning_logs = falseremoves the line ">>>> Executing external compose provider". - Change: remove
compose=docker-compose, the packagesdocker-composeanddocker-compose-v2, and the API service that this value started. Throughdocker compose, Docker Compose fails here for the reason above. The owner rule also replaces Docker tools with Podman tools. - A Docker Compose that the user installs uses
/var/run/docker.sock. Thus it uses the rootful store. NOTES.md says so. compose=noneinstalls no compose tool and writes no compose file.- Change: install
slirp4netnsin install.sh. On ubuntu:noble, Podman 4.9.3 starts the rootless network namespace of a user network withslirp4netns. It does not usedefault_rootless_network_cmdfor this namespace. Without the package,podman-compose upfails with "failed to mount runtime directory for rootless netns", and podman-compose 1.0.6 exits 0. After one such failure, a later install ofslirp4netnsin the same container did not make the network work. Thus the package must be in the image before the first rootless run. Podman 5 does not use the package.
Socket and group
- Change: with active
dockerCompat, the entrypoint startspodman system service --time=0 unix:///run/podman/podman.sockas root. PR feat: add the podman-in-podman Feature 1.0.0 #9 starts a rootless service in/run/user/<uid>/podman, also forcompose=docker-compose. - Podman makes the socket
root:root 0600. The entrypoint waits for the new socket. Then it sets the socket toroot:docker 0660. - The entrypoint links
/var/run/docker.sockto/run/podman/podman.sock. The tmpfiles.d rule ofpodman-dockernames the same link:L+ %t/docker.sock - - - - %t/podman/podman.sock. The images have nosystemd-tmpfiles, and the postinst ofpodman-dockerruns it only when it is present. Thus the entrypoint makes the link. - Change: install.sh makes the system group
dockerwhen it is missing and adds the remote user.podman-dockermakes no group. Remove the NOTES.md sentence "Podman has no daemon, so the Feature adds no group".
Two stores
- The remote user's
podman,docker,docker composeandpodman-composeuse the rootless store/var/lib/containers-rootless/<user>. sudo podman,sudo dockerand each client of/var/run/docker.sockuse the rootful store/var/lib/containers/storage. Examples are Docker SDKs, Testcontainers and a Docker Compose that the user installs.- NOTES.md (Docker compatibility) names the two stores. It gives the command that copies an image to the rootful store:
podman save <image> | sudo podman load.
Environment
- containerEnv sets no variable.
- Do not set
CONTAINER_HOST. It makes eachpodmancall remote. - Do not set
DOCKER_HOST. Docker API clients use/var/run/docker.sockby default, as with both upstream Docker Features. - Do not set
DOCKER_BUILDKIT. No Docker CLI reads it. The CLI writes containerEnv as DockerfileENVlines in install order. Thus a value would also replace theDOCKER_BUILDKIT=1of docker-in-docker. - NOTES.md names
/etc/profile.d/podman-docker.shand/etc/profile.d/podman-docker.cshof the Debian package. A login shell that reads them setsDOCKER_HOSTwhen it is not set. For root, the value isunix:///run/podman/podman.sock, the socket of this Feature. For another user withXDG_RUNTIME_DIR, the value isunix://$XDG_RUNTIME_DIR/podman/podman.sock. No service runs there. Such a user setsDOCKER_HOST=unix:///var/run/docker.sockinremoteEnv. The VS Code server givesXDG_RUNTIME_DIRto its extension host and to the processes under it, so this case occurs in a devcontainer. The ubuntu:noble package has no such files.
Entrypoint, ready marker and check
- Keep the entrypoint
/usr/local/share/podman-init.sh. podman-outside-podman uses the same path. Upstream, both Docker Features use/usr/local/share/docker-init.sh. - Keep the pattern: POSIX sh, run as root (through
sudo -nwhen the user is not root), no change on a second run,exec "$@"at the end. - Keep all runtime files in
/run/podman-in-podman/:ready, the PID file and the log of the API service. Change: move the PID file and/tmp/podman-service.logthere. - Change:
/runis not a tmpfs under Docker. The socket and the PID file stay after a stop and a start of the container. The service runs only if the PID file names a live process whose/proc/<pid>/cmdlineispodman system service. Do not usekill -0alone. After a restart, the old PID can belong to a different process. - Change: when the service does not run, remove the socket and the PID file, start the service, and wait for the new socket. Then run
chgrpandchmod. If the old socket stays, the wait ends at once, andchgrpchanges the old file. The new service then makes the socketroot:root 0600again. - Change: add
"postStartCommand": "/usr/local/share/podman-check.sh". The script runs as the remote user and waits up to 60 seconds forready. It runspodman info. When the config records the/var/run/docker.socklink (activedockerCompat), the script also runspodman --url unix:///var/run/docker.sock info. Do not usedockerfor this call, becausedockerruns rootless Podman here. Do not use the path alone, because docker-in-docker can own it. The script prints one line that starts withpodman-in-podman:. On failure, it prints(!) podman-in-podman:and the log path, and exits 1. - NOTES.md (Start of the container) says: when the check fails, the Dev Containers CLI does not run the later
postStartCommandandpostAttachCommandof the user.
Marker directory and exclusion
- Change: install.sh first stops with an error when
/usr/local/share/podman-outside-podmanexists. The message is(!) podman-in-podman and podman-outside-podman cannot be in one container.podman-outside-podman does the same check in the other direction. - Then install.sh makes
/usr/local/share/podman-in-podman/and writes its config there. - Neither Feature lists the other in
installsAfter. Each Feature checks for the other, so the second install stops in each order.
docker-in-docker and docker-outside-of-docker
- With docker-in-docker or docker-outside-of-docker, the
dockerCompatskip applies (see "The docker command").compose=podman-composestill works, because it uses thepodmancommand. - Change:
installsAfteris common-utils, docker-in-docker and docker-outside-of-docker. podman-outside-podman uses the same list.
Shared file
- Change: move the shared install steps to
scripts/podman-common.sh, and source it from install.sh. The file holds the root and apt-get checks and the remote user rule. Forautomatic, the rule takes vscode, node, codespace or the uid 1000 user, else root, as upstream does. The file also holds the exclusion check, the marker directory, thedockerCompatskip, thepodman-dockerinstall withmkdir -p /etc/containersand/etc/containers/nodocker, thedockergroup, and thepodman-composeinstall withmkdir -p /etc/containers/containers.conf.dand its compose file. The caller gives its Feature ID for the file name. - The file defines only functions. Put
# shellcheck source=SCRIPTDIR/scripts/podman-common.shon the line above the line that sources it. The lint runs shellcheck without-x. Without the directive, SC1091 fails the lint. A top-level variable that only install.sh reads gives SC2034. - podman-outside-podman keeps a byte-identical copy. Its PR adds one line to the lint workflow:
cmp src/podman-in-podman/scripts/podman-common.sh src/podman-outside-podman/scripts/podman-common.sh. Upstream copiesscripts/version-resolution.shinto 14 Features and checks each copy withcmp -s. - The entrypoint, the check script and
podman-subid-ranges.share not shared. They do different work in each Feature.
NOTES.md
- Use these headings, in this order: Use, Security, Start of the container, Docker compatibility, Storage, Limits, OS support. This is a project rule. podman-outside-podman uses the same order, with its own sections in the place of Storage.
- Docker compatibility says that the Feature installs
podman-dockerand no Docker CLI or BuildKit. It names whatdockerruns, the skip rule,/var/run/docker.sock,/run/podman/podman.sock, thedockergroup, the compose file, the two stores and the profile.d note. - Limits adds name resolution on debian:sid. aardvark-dns 1.17 puts an inotify watch on
/etc/resolv.conf, and it stops when it cannot add the watch. When the host user has no free inotify watches, containers on a Podman network cannot find each other by name. The fix is on the host: raisefs.inotify.max_user_watches, or make other programs use fewer watches.
Tests
- Each test script starts with
check "podman-check" /usr/local/share/podman-check.sh. - Both Features use these scenario names with the same options:
compose_podman(defaults),docker_compat(dockerCompat=true),minimal,with_docker_in_dockerandidempotent(dockerCompat=true).test.shuses the defaults. - Change: rename
compose_dockertodocker_compat, and removecompose=docker-composefrom it. It checks these items:dpkg -S /usr/bin/dockernamespodman-docker, anddpkg-queryfinds none ofdocker-cli,docker.ioanddocker-ce-cli.docker versionprints "Podman Engine".- The link target is
/run/podman/podman.sock, and the socket isroot:dockerwith mode660. - As the remote user,
podman --url unix:///var/run/docker.sock inforeports that rootless is false. docker compose upstarts two services.docker compose exec b ping -c1 -W5 aexits 0.docker compose downremoves them.podman image existsfinds the image fromdocker build, andsudo podman image existsdoes not find it.
compose_podmanchecks thatpodman compose versionnames podman-compose and that/etc/containers/containers.conf.d/50-podman-in-podman-compose.confexists. It starts two services,podman compose exec b ping -c1 -W5 amust exit 0, andpodman compose downremoves them. No API service runs.with_docker_in_dockerchecks four things. The skip line is in the build log, andpodman-dockeris not installed./var/run/docker.sockis not a link.dockerreaches dockerd. The check script exits 0.- Change:
idempotentadds a restart case. Stop the API service with SIGKILL and run the entrypoint again. The socket must beroot:dockerwith mode660. The remote user must reach it withpodman --url unix:///var/run/docker.sock info. - Check the state of the containers and the exit status of
exec. Do not use the exit code ofpodman-compose upor ofpodman logs. On ubuntu:noble, podman-compose 1.0.6 exits 0 when a container does not start.podman logsexits 0 also when the ping failed. - When name resolution fails on debian:sid, first look at the free inotify watches of the host (see Limits).
- The test job adds one negative step. A container with
/usr/local/share/podman-outside-podmanruns install.sh. install.sh must exit non-zero with the message. - The images stay debian:sid, debian:trixie and ubuntu:noble, linux/amd64 only.
Evidence (2026-11-19)
Privileged containers ran the rootful podman system service, with the docker group and the /var/run/docker.sock link. The podman-docker versions were 5.8.6 (debian:sid), 5.4.2 (debian:trixie) and 4.9.3 (ubuntu:noble).
- As
vscode,docker inforeported a rootless store in/var/lib/containers-rootless/vscode.sudo docker inforeported/var/lib/containers/storage. The image fromdocker buildwas only in the rootless store.podman --url unix:///var/run/docker.sock inforeported that rootless is false. Localdocker versionprinted only "Client: Podman Engine".docker buildx versionprinted "buildah 1.43.2" (debian:sid). - With podman-compose 1.6.0, 1.3.0 and 1.0.6,
docker compose upanddownworked asvscodewith no API socket. On ubuntu:noble, this neededslirp4netns. On debian:trixie and ubuntu:noble,docker compose exec b ping -c1 -W5 aexited 0 in 6 of 6 cycles. - On debian:sid, the same check failed in 6 of 6 cycles with "ping: bad address". aardvark-dns 1.17.1 tried to add an inotify watch on
/etc/resolv.conf, got ENOSPC, and stopped with a panic. On the measurement host, the VS Code server held 524137 of the 524288 inotify watches of the host user. Each nested user namespace counts against the same host user. aardvark-dns 1.14.0 (debian:trixie) and 1.4.0 (ubuntu:noble) do not use this watch. The same cause made rootful network removal fail sometimes on debian:sid ("aardvark-dns failed to start"). Name resolution on debian:sid was not measured on a host with free watches. The CI test job measures it. - With Docker Compose (2.40.3, 2.26.1, 2.40.3),
docker compose upfailed with "Cannot connect to the Docker daemon at unix:///run/user/1000/podman/podman.sock". With both tools and nocompose_providersline,podman composeselected Docker Compose (debian:sid, ubuntu:noble). With the line, it selected podman-compose on all three images. - No image has
systemd-tmpfiles. After the install, no/run/docker.socklink exists./var/runis a link to/run. - On debian:trixie,
apt-get install -y podman-dockerremoveddocker-cli. - On ubuntu:noble, after a rootless run failed without
slirp4netns, a later install ofslirp4netnsin the same container did not make the network work.
Proof
test-pr.yaml on ubuntu-latest: the default test and all 9 scenarios pass on debian:sid, debian:trixie and ubuntu:noble. lint passes (shellcheck, docs drift, version 1.0.0). The podman-host shim job runs rootless_vscode under rootless Podman with keep-id. If it fails on the AppArmor user-namespace restriction, that job sets the sysctl (owner decision of 2026-11-19), the README records it, and the PR says so. The PR changes nothing else to make a job pass. Local run in the owner's devcontainer: npx devcontainer features test -f podman-in-podman -i debian:sid . passes. That run covers the keep-id user namespace. After merge, release.yaml publishes ghcr.io/dan-petty/devcontainer-features/podman-in-podman:1, and devcontainer features info tags ghcr.io/dan-petty/devcontainer-features/podman-in-podman lists 1, 1.0, 1.0.0 and latest.
Depends on: #3
Alternatives check of 2026-11-19: none.
Tool: none found.
Reason: Searches found no Feature that runs a nested Podman engine: the closest, devcontainers-extra's Homebrew podman Feature, installs only a client, and the community index and a podman-named template repo hold nothing nested.
Lacks:
- No privileged mode or storage volumes for nesting
- No entrypoint for cgroups, subuid or subgid setup
- No rootless/rootful run or Docker-compatible socket
- No podman Feature in devcontainers/features or the index
Proposed design
Problem statement
Add the podman-in-podman Feature 1.0.0, its tests, the CI jobs and the workflow fixes recorded in the issue in one pull request; hold the minikube --driver=podman scenario for a later issue. The Feature runs a full Podman engine in the dev container, with rootless use by the remote user and rootful use through sudo. It works under a Docker outer engine and under rootless Podman with --userns=keep-id, replacing docker-in-docker and removing the /etc/os-release rewrite. No open, maintained tool covers the need, so the change builds the Feature around the Debian packages.
Acceptance criteria
Requirement: Feature metadata declares privileged mode, entrypoint and volumes
src/podman-in-podman/devcontainer-feature.json MUST set privileged to true, entrypoint to /usr/local/share/podman-init.sh, and two volume mounts for /var/lib/containers and /var/lib/containers-rootless.
Scenario: Metadata live check
- WHEN
npx devcontainer features test -f podman-in-podman -i debian:sid .builds the default test container - THEN the command exits 0 and the container starts with
/usr/local/share/podman-init.shas the entrypoint and both volumes mounted
Requirement: Install script installs Podman and optional tools
install.sh MUST install podman, crun, conmon, netavark, aardvark-dns, nftables, passt, uidmap, catatonit, containers-storage, golang-github-containers-common and fuse-overlayfs, and MUST install buildah and skopeo when their options are true.
Scenario: Default install
- WHEN the default test runs in the built container
- THEN
podman,buildah,skopeoandpodman-composeexist, anddocker-composeandpodman-dockerare absent
Requirement: Entrypoint configures cgroup v2 nesting
The entrypoint MUST move every PID to /sys/fs/cgroup/init and MUST enable each controller in cgroup.subtree_control before any Podman call.
Scenario: Rootful Podman run
- WHEN the default test runs
podman run --rm quay.io/podman/helloas root - THEN the command exits 0 and
podman inforeports cgroups v2, netavark, crun and cgroupfs
Requirement: Rootless storage uses the mounted volume
The entrypoint MUST set the rootless storage path to /var/lib/containers-rootless/<user> and MUST make that directory owned by the user.
Scenario: Rootless run as vscode
- WHEN the
rootless_vscode_keepidscenario runspodman infoas vscode - THEN
podman inforeportsGraphRoot: /var/lib/containers-rootless/vscodeandNative Overlay Diff: true
Requirement: Subordinate ID ranges fit the user namespace
The entrypoint MUST write /etc/subuid and /etc/subgid ranges that lie inside /proc/self/uid_map and gid_map, and MUST run podman system migrate when the files change.
Scenario: Keep-id map
- WHEN the
subid_rangesscenario runs/usr/local/share/podman-subid-ranges.shwith the map0 1 1000 / 1000 0 1 / 1001 1001 64536 - THEN the script prints
1:999and1001:64535
Requirement: dockerCompat installs the Docker shim and socket
When dockerCompat is true, install.sh MUST install podman-docker and touch /etc/containers/nodocker, and the entrypoint MUST start the Podman API socket and link /var/run/docker.sock to it.
Scenario: Compose with docker-compose
- WHEN the
compose_dockerscenario runsdocker version - THEN the output shows a Podman server and
/var/run/docker.sockis a symbolic link
Requirement: dockerCompat skips when another Docker CLI exists
When /usr/bin/docker exists and dpkg -S /usr/bin/docker does not name podman-docker, install.sh MUST print the skip message and MUST NOT fail.
Scenario: docker-in-docker present
- WHEN the
with_docker_in_dockerscenario installs this Feature withdockerCompat=trueafter docker-in-docker - THEN the install log contains
(!) A docker CLI is present; dockerCompat is skippedand the Feature install exits 0
Requirement: Compose option selects the compose tool
The compose option MUST install podman-compose for podman-compose, docker-compose for docker-compose, and no compose tool for none.
Scenario: Minimal install
- WHEN the
minimalscenario runs withbuildah=false,skopeo=falseandcompose=none - THEN
buildah,skopeoandpodman-composeare absent andpodmanstill runs
Requirement: Entrypoint is idempotent
A second run of /usr/local/share/podman-init.sh MUST exit 0 and MUST NOT change the cgroup, subid or storage state.
Scenario: Second start
- WHEN the
idempotentscenario runssudo /usr/local/share/podman-init.sh truea second time - THEN the command exits 0 and the cgroup, subid and storage state are unchanged
Requirement: Rootful limits and bridge networking apply
Rootful Podman MUST apply the memory and CPU limits of podman run and MUST place the default bridge network in 10.88.0.0/16.
Scenario: Rootful limits
- WHEN the
rootful_limitsscenario runssudo podman run --memory 64m --cpus 0.5and reads the container'smemory.max,cpu.maxandpodman network inspect podman - THEN
memory.maxis67108864,cpu.maxis50000 100000, and the bridge address is in10.88.0.0/16
Requirement: Compose services resolve by name
podman-compose MUST resolve two services by name through aardvark-dns without a running Podman API service.
Scenario: Compose with podman-compose
- WHEN the
compose_podmanscenario runspodman-compose upand resolves one service from the other - THEN each service resolves the other's name and no
podman system serviceprocess runs
Requirement: CI workflow runs the Feature on the chosen images
test-pr.yaml MUST add a dedicated podman-in-podman job that runs the default test and all nine scenarios with debian:sid, debian:trixie and ubuntu:noble as base images, and MUST skip the shared test and test-scenarios steps for this Feature.
Scenario: Pull request CI
- WHEN the
test-pr.yamlworkflow runs for a pull request that changessrc/podman-in-podman/**ortest/podman-in-podman/** - THEN the dedicated
podman-in-podmanjob runs the default test and all nine scenarios on the three base images, the shared steps do not run for this Feature, and the workflow exits 0
Requirement: Rootless Podman outer engine job
The existing podman-host job in test-pr.yaml MUST run the rootless_vscode_keepid scenario under rootless Podman with --userns=keep-id through a docker shim.
Scenario: Podman host job
- WHEN the
podman-hostjob runs onubuntu-latest - THEN the job runs
rootless_vscode_keepidand exits 0, or setskernel.apparmor_restrict_unprivileged_userns=0and records it insrc/podman-in-podman/NOTES.md
Requirement: Documentation states the limitations and options
src/podman-in-podman/NOTES.md MUST state that privileged: true removes seccomp and gives all capabilities, that rootful bridge egress fails next to docker-in-docker, that rootless --memory is ignored, and that WSL2 delegates only the cpu, memory and pids controllers; src/podman-in-podman/README.md MUST list the four options; and the root README.md MUST add a podman-in-podman row.
Scenario: Documentation generation
- WHEN the
lintworkflow runsnpm run docsand the documentation drift check - THEN the workflow exits 0 with no drift for
src/podman-in-podman/README.md, the generated README listsbuildah,skopeo,composeanddockerCompat, and the rootREADME.mdtable has thepodman-in-podmanrow
Requirement: Scenario job skips the duplicate test
The test-scenarios job in test-pr.yaml MUST pass --skip-duplicated, and CONTRIBUTING.md MUST show the same command.
Scenario: Scenario job skips duplicate test
- WHEN the
test-scenariosjob runs in pull request CI - THEN the job log shows
--skip-duplicatedand the job exits 0
Requirement: Test-all workflow tests each Feature alone
test-all.yaml MUST test each Feature alone on debian:sid as well as together, and MUST fix the comment at lines 26-28.
Scenario: Test all solo
- WHEN the
test-all.yamlworkflow runs - THEN each Feature has a solo
npx devcontainer features test -f <id> -i debian:sidrun and the workflow exits 0
Requirement: Release workflow concurrency and permissions
release.yaml MUST set a concurrency group, and release.yaml and test-pr.yaml MUST document their permissions so that the zizmor pedantic check passes.
Scenario: Release workflow lint
- WHEN the repository workflow lint runs
zizmorin pedantic mode onrelease.yamlandtest-pr.yaml - THEN
zizmorreports noconcurrency-limitsorundocumented-permissionsfindings and exits 0
Requirement: Lint version check uses semver
The lint.yaml version check MUST compare versions with a semver comparator, so a release after a pre-release passes.
Scenario: Version after pre-release
- WHEN the
lint.yamlversion check compares1.1.0-rc.1with1.1.0 - THEN the check exits 0 and reports
1.1.0as higher
Requirement: Root README counts agree
README.md:7 MUST show counts of installed, refused and listed Features that agree with the upstream Features table. No workflow checks those counts: the owner rule of 2026-11-16 forbids a test of a document or config value.
Scenario: Documentation drift
- WHEN a person reads
README.md:7and the upstream Features table - THEN the installed, refused and listed counts agree
Existing Tool Considered
The alternatives block of 2026-11-19 records Tool: none found and its Lacks: list gives the gaps; no open, maintained tool or Feature covers nested Podman. The change builds its own Feature around the Debian podman packages. Written cost: about 35k tokens to build, about 10k tokens per year to keep and fix, about 3 engineer-days.
Key questions
- Which Feature ID and package source does the project require?: Keep the Feature ID
podman-in-podman. Install Podman, buildah, skopeo and the compose tools from the Debian archive with no version pins; the packages float with the base distribution. (best practice) [sources: CONTRIBUTING.md:8, CONTRIBUTING.md:9, README.md:68]- Chosen: Debian apt. The project rule installs packages from the Debian archive with no version pin, and the Feature folder name must match the id.
- Rejected: Upstream static binaries. Adds a download, checksum and upgrade path that the no-pin rule excludes.
- Rejected: Homebrew podman Feature. Installs only a client with no privileged mode, mounts, entrypoint or subuid setup.
- Which compose tool and
dockerCompatdefault does the project use?: Keepcompose=podman-composeanddockerCompat=falseas defaults. The devops-cli devcontainer sets onlydockerCompat: true(owner rule of 2026-11-19: no Docker CLI).- Chosen: podman-compose default. It drives the Podman CLI directly, so it works without an API service.
- Rejected: docker-compose default. Compose v2 needs a Docker-compatible API endpoint; without
podman system service, the rootless socket is absent. - Rejected: compose=none default. Removes a working compose path that the owner wants by default.
- Which base images and architecture do the tests target?: Test on
debian:sid,debian:trixieandubuntu:noble, onlinux/amd64only. The sharedtestmatrix currently runs onlydebian:sid, so a dedicated job is needed. (best practice) [sources: .github/workflows/test-pr.yaml:60, .github/workflows/test-manual.yaml:11, README.md:1]- Chosen: Three images, amd64 only. Covers the newest Debian and the Ubuntu LTS that the owner uses; arm64 stays out of scope.
- Rejected: Only debian:sid. Hides package differences in trixie and noble.
- Rejected: Add linux/arm64. Nested Podman under emulation is unproven and outside the owner's target.
- May the rootless test job change the AppArmor sysctl on the runner?: Yes. Only the rootless Podman test job may run
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0on the ephemeral GitHub runner. The README records it. No other job or setting changes to make a test pass. (a person decides) [sources: .github/workflows/test-pr.yaml:103, .github/workflows/test-pr.yaml:134] - How does
test-pr.yamldetect a new Feature?: Thedetect-changesjob derives Feature IDs from changedsrc/<id>/**andtest/<id>/**paths. A new Feature needs no filter line. [sources: .github/workflows/test-pr.yaml:31, .github/workflows/test-pr.yaml:40, .github/workflows/test-pr.yaml:43, CONTRIBUTING.md:9] - How does the
podman-hostjob select the rootless scenario?: The job runs scenarios whose names containkeepid. Name the rootless scenariorootless_vscode_keepidso the existing filter selects it. (best practice) [sources: .github/workflows/test-pr.yaml:99, .github/workflows/test-pr.yaml:134, CONTRIBUTING.md:62]- Chosen: Name the scenario
rootless_vscode_keepid. The existingpodman-hostjob filterskeepid, so the scenario runs there with no workflow filter change. - Rejected: Change the job filter to add
rootless_vscode. Adds a second filter path and departs from the keepid convention.
- Chosen: Name the scenario
- What must the root
README.mdchange?: Add thepodman-in-podmanrow to the Features table at lines 18-19, because line 16 says each Feature pull request adds its row. Fix line 7: it says 12 of 28 Features installed and 16 not included, but the upstream table at lines 25-37 lists 11 Features. Make the installed, refused and listed counts agree. [sources: README.md:7, README.md:16, README.md:18, README.md:27, CONTRIBUTING.md:9] - How does the documentation workflow generate Feature READMEs?:
package.json:13definesnpm run docswithdevcontainer features generate-docs;lint.yaml:30-40runs it and fails onsrc/*/README.mddrift. There is noupdate-documentation.yml. The rootREADME.mdis not generated by this script, so its Feature row is edited by hand. [sources: package.json:13, .github/workflows/lint.yaml:30, .github/workflows/lint.yaml:37, README.md:62] - How does a scenario file declare a scenario?:
README.md:64requirestest/<id>/scenarios.jsonwith one<scenario>.shper scenario;CONTRIBUTING.md:47runs them withnpx devcontainer features test -f <id> --skip-autogenerated. [sources: README.md:64, CONTRIBUTING.md:47] - Can this repository rely on upstream docker-in-docker for cgroup v2 nesting?: This repository does not hold the upstream docker-in-docker code, so it cannot source its cgroup or privileged behavior from here.
README.md:7andREADME.md:39record that docker-in-docker and docker-outside-of-docker do not install ondebian:sid; the Feature therefore implements its own cgroup nesting and only combines with docker-in-docker in thewith_docker_in_dockerscenario that uses the owner's os-release rewrite. [sources: README.md:7, README.md:39] - How should
test-pr.yamlrun this Feature on the three images?: Add a dedicatedpodman-in-podmanjob with a three-image matrix. Keep automatic detection; no filter line. The sharedtestjob only runsdebian:sid, so skip its step for this Feature; skip the sharedtest-scenariosstep too, because the dedicated job runs the scenarios on the three images. (best practice) [sources: .github/workflows/test-pr.yaml:51, .github/workflows/test-pr.yaml:60, .github/workflows/test-pr.yaml:76, .github/workflows/test-pr.yaml:97, CONTRIBUTING.md:9]- Chosen: Dedicated three-image job and skip shared steps. The shared
testjob only runsdebian:sid, and skipping its step for this Feature avoids a duplicate run. - Rejected: Add a filter line only.
test-pr.yamlderives Feature ids from changed paths, so a filter line adds no test. - Rejected: Use the shared matrix only. The shared matrix does not run
debian:trixieorubuntu:noble.
- Chosen: Dedicated three-image job and skip shared steps. The shared
- Are the PR chore: reset the repository to the Dev Container Features format #4 workflow points part of this issue?: Yes. Add
--skip-duplicatedtotest-scenariosandCONTRIBUTING.md; add solo Feature runs totest-all.yamland fix its comment; add a concurrency group and permission comments torelease.yaml; replacesort -Vinlint.yamlwith a semver compare; make theREADME.md:7counts agree. (best practice) [sources: .github/workflows/test-pr.yaml:97, .github/workflows/test-all.yaml:38, .github/workflows/release.yaml:1, .github/workflows/lint.yaml:65, README.md:7]- Chosen: Fix them in this pull request. The issue records them as work points from the review of PR chore: reset the repository to the Dev Container Features format #4 and the same CI run proves them.
- Rejected: Defer them to a later issue. The body does not defer them; the Feature PR runs the test jobs first and needs the fixes.
Open questions
- May the rootless test job change the AppArmor sysctl on the runner? (a person decides)
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 19, 2026
podman-in-podman, and .github/labels.yml declares no scope/podman-in-podman label. Add the label to the file to give the scope to this item.Both target the devcontainers/features repository layout; item 3 sets up the format, the candidate adds one specific Feature within it.devops-cli-service commentedon Nov 19, 2026
Owner question: See the first point of Open questions in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 19, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (10)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Nov 19, 2026
Owner question: See the first point of Open questions in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence