Repository navigation
Description
Goal
Give the dev container a client for the host's Podman engine through a bind-mounted API socket directory. No engine runs in the container. This is the Podman form of docker-outside-of-docker, which fails on debian:sid. The owner asked for it. It does not go in the devtools base image or the cluster Jobs, because its static CONTAINER_HOST forces remote mode and no socket is mounted there. It cannot be combined with podman-in-podman.
Why no open Feature: Upstream docker-outside-of-docker 1.10.3 targets Docker and fails on debian:sid. Its codename list at install.sh:27 has no forky, and :229-233 exit 1 with "Unsupported distribution version 'forky'". The Docker repository has no forky or sid suite. Its socket logic starts a needless root socat proxy in the keep-id case, and it carries a copied version pin at :14. NerdIT-Tech podman-remote v0.1.0 is the only open alternative (MIT, last commit 2026-10-05, not listed on containers.dev). It binds a socket file at /tmp/podman.sock, and a file bind goes stale when the host makes the socket again. It has no proxy fallback for a host without keep-id. It is a single-maintainer 0.1 project, so it does not meet the owner's rule for reputable, maintained dependencies. The owner asked for this Feature by name.
Change
Scope: src/podman-outside-podman/ and test/podman-outside-podman/ as below. Add the workflow steps that start the runner's rootful and rootless Podman services before the tests, one filter line, and one README row. It does not change src/podman-in-podman: only this Feature checks the other's marker, and its installsAfter sets the order.
Decisions (owner, 2026-11-19): keep the Feature ID podman-outside-podman. Ship the default mount ${localEnv:XDG_RUNTIME_DIR:/run/user/1000}/podman; container start fails when that folder is missing, as docker-outside-of-docker does, and the README gives the override and an initializeCommand. Packages come from the distribution archive with no pins. The tests run on debian:sid, debian:trixie and ubuntu:noble, linux/amd64 only.
Options
| Option | Type | Default | Description |
|---|---|---|---|
dockerCompat |
boolean | true |
Install docker-cli and docker-compose from the distribution archive with --no-install-recommends. This keeps docker-buildx out, so docker build uses the classic builder, which Podman's API serves. BuildKit builds fail against Podman with 404 on POST /session. Also link /var/run/docker.sock to the client socket for tools that hard-code that path. |
Metadata (devcontainer-feature.json)
{
"id": "podman-outside-podman",
"version": "1.0.0",
"name": "Podman outside of Podman",
"documentationURL": "https://github.com/dan-petty/devcontainer-features/tree/main/src/podman-outside-podman",
"mounts": [
{
"source": "${localEnv:XDG_RUNTIME_DIR:/run/user/1000}/podman",
"target": "/run/podman-host",
"type": "bind"
}
],
"securityOpt": [
"label=disable"
],
"containerEnv": {
"CONTAINER_HOST": "unix:///run/podman-outside/podman.sock",
"DOCKER_HOST": "unix:///run/podman-outside/podman.sock",
"DOCKER_BUILDKIT": "0"
},
"entrypoint": "/usr/local/share/podman-outside-init.sh",
"postStartCommand": "/usr/local/share/podman-outside-check.sh",
"installsAfter": [
"ghcr.io/devcontainers/features/common-utils",
"ghcr.io/dan-petty/devcontainer-features/podman-in-podman"
]
}Not set: privileged, capAdd, init, dependsOn. Reasons: (1) The mount is the socket's directory, not the socket file. A file bind keeps the old inode after the host makes the socket again, and a directory bind does not. (2) The CLI substitutes ${localEnv:...} in Feature metadata, also from the label of a prebuilt image. The spec names only ${devcontainerId} there. The default /run/user/1000 serves the owner's VS Code WSL server, which has no XDG_RUNTIME_DIR. A variable that is set but empty gives '/podman', and a nested default does not work. (3) A devcontainer.json mount with the same target replaces this mount. The README shows the override for another uid (/run/user//podman) and for a rootful host (/run/podman). (4) label=disable lowers SELinux separation. The README must say so (owner rule), as upstream docker-outside-of-docker does and as the CLI does for Podman on Linux. (5) containerEnv holds constants only, because the CLI writes it as Dockerfile ENV. LOCAL_WORKSPACE_FOLDER, keep-id and initializeCommand must go in the user's devcontainer.json. (6) installsAfter podman-in-podman makes podman-in-podman install first when both are listed, so this Feature's exclusion check sees it.
install.sh, the entrypoint and the check
install.sh runs as root at image build:
set -e. Stop if not root. Stop with a clear message if apt-get is absent. Read DOCKERCOMPAT="${DOCKERCOMPAT:-true}". Take USERNAME from _REMOTE_USER with the 'automatic' fallback.- If /usr/local/share/podman-in-podman exists, stop: 'podman-outside-podman cannot be combined with podman-in-podman; CONTAINER_HOST would force every podman call to the host'. Make the marker directory /usr/local/share/podman-outside-podman/.
rm -rf /var/lib/apt/lists/*,apt-get update, thenapt-get install -y --no-install-recommends podman-remote socat, plus docker-cli and docker-compose when DOCKERCOMPAT is true. podman-remote depends only on libc6 and libsqlite3-0, and docker-cli only on libc6. Use no pins, downloads or third-party repositories. Do not use podman-docker, which pulls in the full engine.- If /usr/bin/podman does not exist, link /usr/local/bin/podman to /usr/bin/podman-remote.
- Install /usr/local/share/podman-outside-init.sh and /usr/local/share/podman-outside-check.sh, with the remote user and the dockerCompat value written in.
- Clear the apt lists.
Entrypoint /usr/local/share/podman-outside-init.sh runs as root (through sudo when not root), is idempotent, and ends with exec "$@":
- a. Make /run/podman-outside.
- b. If
runuser -u <user> -- podman-remote --url unix:///run/podman-host/podman.sock infoworks, link /run/podman-outside/podman.sock to /run/podman-host/podman.sock. This is the keep-id case: the socket and its 0700 directory appear as owned by vscode, so no proxy is needed. Upstream docker-outside-of-docker would start an unneeded socat here, because it checks only the gid. - c. Otherwise (root-owned socket, foreign uid, no keep-id), start
socat UNIX-LISTEN:/run/podman-outside/podman.sock,fork,mode=660,user=<user> UNIX-CONNECT:/run/podman-host/podman.sockdetached. This is the fallback branch of docker-outside-of-docker install.sh:508-521, without its repository and version code. - d. If dockerCompat is true, link /var/run/docker.sock to /run/podman-outside/podman.sock.
postStartCommand /usr/local/share/podman-outside-check.sh runs as the remote user. It runs podman --remote info and prints whether the host engine is rootless or rootful. On failure it prints the host fix and exits non-zero, so VS Code shows the error and the container stays usable. The host fix: [boot] systemd=true in /etc/wsl.conf, systemctl --user enable --now podman.socket, sudo loginctl enable-linger $USER, or without systemd podman system service --time=0 &. A missing socket directory stops container create before any Feature code runs. So the README gives an initializeCommand for the user's devcontainer.json: sh -c 'XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR:-/run/user/$(id -u)} systemctl --user start podman.socket'.
README (NOTES.md): the security risk, remoteEnv LOCAL_WORKSPACE_FOLDER and the ${LOCAL_WORKSPACE_FOLDER:-./} compose pattern, because nested -v paths resolve on the host, and the BuildKit limit.
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. Before the tests, the CI job starts a host engine on the stock runner, which has Podman 4.9.3. The Podman 5.8 client accepts servers from libpod API 4.0.0 (podman v5.8.0 version/version.go:40, pkg/bindings/connection.go:399-405, read for this design).
test/podman-outside-podman/test.sh (default options and the default mount): a workflow step first runs sudo install -d /run/user/1000/podman and a rootful sudo podman system service --time=0 unix:///run/user/1000/podman/podman.sock in the background, so the default source exists. The test runs as root. It checks that podman-remote is installed and that podman resolves to it. It checks CONTAINER_HOST, DOCKER_HOST and DOCKER_BUILDKIT=0, that podman --remote info works, and that docker-cli and docker-compose exist while docker-buildx does not. docker version must show a Podman server. docker run --rm quay.io/podman/hello must work. A docker build of a small Containerfile must use the classic builder. /var/run/docker.sock must be a link. The check script must exit 0.
scenarios.json:
- rootful_proxy: remoteUser vscode. A mount override has source /run/podman and the same target. initializeCommand runs
sudo systemctl start podman.socket. The socket is root:root 0660, so the entrypoint takes the socat path. vscode can runpodman info, and the check prints 'rootful'. - foreign_uid_proxy: a workflow step starts the runner user's rootless
podman system service --time=0on /run/user/1001/podman/podman.sock. A mount override points at that directory. vscode (1000) cannot use a socket owned by uid 1001, so the socat path runs, and the check prints 'rootless'. - keepid_direct: the podman-host job with a
dockershim to Podman first on PATH. The CLI adds --userns=keep-id. The mount is overridden to ${localEnv:XDG_RUNTIME_DIR}/podman, because the runner uid is 1001. No socat process runs, and vscode connects directly. - named_volume:
podman volume createanddocker run -v <name>:/dshare data by name with the host engine.
What CI cannot prove: the owner's WSL host (systemd, linger, the VS Code WSL server without XDG_RUNTIME_DIR, and whether /run/user/1000 exists after wsl --shutdown). Also not proven: Podman 5.7's error for a missing bind source (only Docker's refusal was tested), SELinux (the runner uses AppArmor), the ${localEnv} substitution in Codespaces or DevPod, and arm64. A missing socket cannot be a features-test scenario, because container create fails first. The scenarios cannot run inside a devcontainer that has no Podman engine. After the owner's devcontainer moves to podman-in-podman, its rootful or rootless socket can be the 'host' for the same steps.
Risk. The socket gives the full power of the host engine (host root for a rootful socket), and label=disable lowers SELinux separation. The default mount source stops container start when the folder is missing or the uid is not 1000. ${localEnv:...} in Feature mounts is CLI behavior that the spec does not define, so Codespaces or DevPod may not substitute it. Against a Podman socket, a BuildKit docker build fails (404 on POST /session); docker-cli without recommends keeps the classic builder, which the Docker CLI marks as deprecated.
Shared implementation with podman-in-podman
podman-outside-podman and podman-in-podman (#5, PR #9) follow one contract, as docker-outside-of-docker and docker-in-docker do upstream. These rules replace parts of the design above. "Change" marks a change to that design.
Change: Depends on: #3, #5. PR #9 must merge first, because it creates scripts/podman-common.sh.
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
- Change: the default of
dockerCompatisfalse, the same as in podman-in-podman.dockerCompatinstallspodman-dockerand makes the/var/run/docker.socklink. - Change: add
compose(podman-composeornone, defaultpodman-compose), the same as in podman-in-podman. With--no-install-recommends,podman-composeneeds only Python packages. It runs thepodmancommand, which ispodman-remotehere. - Add no
buildahorskopeooption. These tools work on local storage, not through the API.
The docker command
- Change:
dockerCompatinstallspodman-docker, notdocker-clianddocker-compose. Useapt-get install -y --no-install-recommends podman-dockerthrough the shared file. Remove the design text "Do not use podman-docker, which pulls in the full engine". podman-dockerdepends onpodman. With the defaultcompose=podman-compose, it adds 32 to 41 packages and 105 to 184 MiB. Withcompose=none, it adds 37 to 48 packages and 105 to 187 MiB. No engine process runs. NOTES.md gives the size.- The
dockerof the package runs/usr/bin/podman.CONTAINER_HOSTmakes that binary remote. Thusdockeruses the host engine, anddocker versionshows the client and the Podman server of the host. - Change: always link
/usr/local/bin/podmanto/usr/bin/podman-remote. The design makes the link only when/usr/bin/podmanis missing, butpodman-dockerinstalls/usr/bin/podman. With the link,podmanon the PATH of the remote user ispodman-remote, with or withoutpodman-docker. Withoutpodman-docker, the link is the onlypodmancommand, and podman-compose needs it. sudoremovesCONTAINER_HOSTfrom the environment. Thussudo dockerruns/usr/bin/podmanas a local engine, and it fails with "cannot clone: Operation not permitted".sudo podmanalso fails on debian:sid. The sudosecure_paththere has no/usr/local/bin, sosudo podmandoes not find the link. It runs/usr/bin/podmanwhenpodman-dockeris installed, and it finds nopodmanwhen it is not.sudo podman-remoteworks on all three images. It uses its root defaultunix:///run/podman/podman.sock, which is the client socket.- NOTES.md says:
sudo dockerfails, andsudo podmancan fail. Rundockeras the remote user, who is in the groupdocker, or runsudo podman-remote. The Feature does not change the sudo policy. - Keep
touch /etc/containers/nodocker. The shared function first runsmkdir -p /etc/containers. - Skip
dockerCompatwith the rule of podman-in-podman. Skip it when/usr/local/share/docker-init.shexists, or when adockercommand on the PATH does not come frompodman-docker.podman-dockerconflicts withdocker-cli,docker.ioanddocker-ce-cli, andapt-get install -y podman-dockerremovesdocker-cli. - Change:
docker buildrunspodman buildthrough the API of the host. Remove the BuildKit text of the design: thedockerCompatrow ("keeps docker-buildx out", "404 on POST /session"), the decision ondocker-cliand the Risk sentence on BuildKit.
Compose
compose=podman-composeinstallspodman-compose. It also runsmkdir -p /etc/containers/containers.conf.dand writes/etc/containers/containers.conf.d/50-podman-outside-podman-compose.conf, with the same two lines as podman-in-podman:compose_providers = ["podman-compose"]andcompose_warning_logs = falsein[engine]. Themkdiris necessary: withdockerCompat=false, the client has onlypodman-remote,socatandpodman-compose, and these packages do not make the directory.- Then
docker compose,podman composeandpodman-composeall run podman-compose. It uses the host engine throughCONTAINER_HOST. - Change: install no
docker-compose. Throughpodman compose, Docker Compose fails on ubuntu:noble. Podman 4.9.3 gives it the local defaultunix:///tmp/podman-run-1000/podman/podman.sock, not theCONTAINER_HOSTvalue. In podman-in-podman, Docker Compose fails on the rootless socket. Thus both Features remove the value. compose=noneinstalls no compose tool and writes no compose file.
Socket and group
- Change: the client socket is
/run/podman/podman.sock, not/run/podman-outside/podman.sock. podman-in-podman uses the same path. It is also the rootful path of Podman (podman.socketlistens on%t/podman/podman.sock) and the root default ofpodman-remote. The mount target stays/run/podman-host. - Change: the entrypoint tests access with
runuser -u <user> -- test -w /run/podman-host/podman.sock, not withpodman-remote info. A connect call on a Unix socket needs write permission, so this test makes the same check. The entrypoint then makes no API call. - Change: before the entrypoint makes the link or starts socat, it removes
/run/podman/podman.sock./runis not a tmpfs under Docker, so an old socket or link stays after a restart. socat does not listen on a path that exists. Upstream docker-outside-of-docker also removes the target before socat. - When the test passes,
/run/podman/podman.sockis a link to the host socket. If not, socat listens on/run/podman/podman.sockwithuser=root,group=docker,mode=660. - Change: install.sh makes the system group
dockerwhen it is missing and adds the remote user. The socat proxy needs the group also whendockerCompatisfalse. - Change:
/var/run/docker.sockis a link to/run/podman/podman.sockonly whendockerCompatis active. The tmpfiles.d rule ofpodman-dockernames the same link, but no image hassystemd-tmpfiles, so the entrypoint makes it.
Environment
- Change: containerEnv sets only
CONTAINER_HOST=unix:///run/podman/podman.sock. - Change: remove
DOCKER_HOST. Docker API clients use/var/run/docker.sockby default, as in both upstream Docker Features. WithdockerCompat=false, that link does not exist, and only clients that readCONTAINER_HOSTreach the host engine. NOTES.md says so. - Change: remove
DOCKER_BUILDKIT=0. No Docker CLI reads it. The CLI writes containerEnv as DockerfileENVlines in install order, so the value would also turn BuildKit off for thedockerdof docker-in-docker. - NOTES.md names
/etc/profile.d/podman-docker.shand/etc/profile.d/podman-docker.cshof the Debian package, as in podman-in-podman. A login shell that reads them setsDOCKER_HOSTwhen it is not set. For root, the value is the client socketunix:///run/podman/podman.sock. For another user withXDG_RUNTIME_DIR, the value is a path where no socket is. Such a user setsDOCKER_HOST=unix:///var/run/docker.sockinremoteEnv. The ubuntu:noble package has no such files.
Entrypoint, ready marker and check
- Change: the entrypoint is
/usr/local/share/podman-init.sh, notpodman-outside-init.sh. podman-in-podman uses the same path. The pattern is the same: POSIX sh, run as root (throughsudo -n), no change on a second run,exec "$@"at the end. - Keep all runtime files in
/run/podman-outside-podman/:ready, the socat PID file and the socat log. - Change: the proxy runs only if the PID file names a live process whose
/proc/<pid>/cmdlineissocat. Do not usekill -0alone. After a restart, the old PID can belong to a different process. - Change: use
"postStartCommand": "/usr/local/share/podman-check.sh", notpodman-outside-check.sh. The form is the same as in podman-in-podman. The script waits up to 60 seconds forreadyand runspodman infoas the remote user, throughCONTAINER_HOST. When the config records the/var/run/docker.socklink, it also runspodman --url unix:///var/run/docker.sock info. It prints one line that starts withpodman-outside-podman:and says whether the host engine is rootless or rootful. On failure, it prints(!) podman-outside-podman:and the host fix, and exits 1. - Change the design text "so VS Code shows the error and the container stays usable". When the check fails, the Dev Containers CLI does not run the later
postStartCommandandpostAttachCommandof the user. NOTES.md (Start of the container) says so. TheinitializeCommandin the README startspodman.socketbefore the container, and this helps to prevent the failure.
Marker directory and exclusion
- Keep the check for
/usr/local/share/podman-in-podman. Use the shared message(!) podman-in-podman and podman-outside-podman cannot be in one container. - Change: podman-in-podman also checks for
/usr/local/share/podman-outside-podman, and PR feat: add the podman-in-podman Feature 1.0.0 #9 adds that check. Remove the sentence "It does not change src/podman-in-podman: only this Feature checks the other's marker, and its installsAfter sets the order." - Change: remove podman-in-podman from
installsAfter, and remove reason (6). With the check in both directions, the order has no effect. The CLI also stops with "installsAfter dependency ... could not be processed" when it cannot get a listed Feature. - Change:
installsAfteris common-utils, docker-in-docker and docker-outside-of-docker, the same list as in podman-in-podman.
Shared file
- Copy
scripts/podman-common.shfrom podman-in-podman byte for byte. Source it from install.sh, with# shellcheck source=SCRIPTDIR/scripts/podman-common.shon the line above. Do not change it in one Feature only. - The file holds the install frame, the exclusion check, the marker directory, the
dockerCompatskip, thepodman-dockerinstall withmkdir -p /etc/containersand/etc/containers/nodocker, thedockergroup, and thepodman-composeinstall withmkdir -p /etc/containers/containers.conf.dand its compose file. - Add one line to the lint workflow:
cmp src/podman-in-podman/scripts/podman-common.sh src/podman-outside-podman/scripts/podman-common.sh. - The entrypoint and the check script are 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, Host socket, Bind mounts from the workspace folder, Limits, OS support. This is a project rule. podman-in-podman has Storage in the place of the two Feature sections.
- Docker compatibility says that the Feature installs
podman-dockerand no Docker CLI or BuildKit. It names whatdockerruns, the size of thepodmanpackage for eachcomposevalue, thesudonote, the skip rule,/var/run/docker.sock,/run/podman/podman.sock, thedockergroup, the compose file and the profile.d note. All tools use one store: the host engine.
Tests
- Each test script starts with
check "podman-check" /usr/local/share/podman-check.sh. - Change: add the shared scenarios with the same options as podman-in-podman:
compose_podman,docker_compat,minimal,with_docker_in_dockerandidempotent.with_docker_in_dockeruses the same Dockerfile as podman-in-podman. - Change:
test.shchecks the new defaults.podman-remoteandpodman-composeare present.podmanresolves to/usr/local/bin/podman, a link topodman-remote.docker,podman-dockerand/var/run/docker.sockare absent.CONTAINER_HOSTis set, andDOCKER_HOSTandDOCKER_BUILDKITare not set.podman compose versionnames podman-compose. The check script exits 0. The Docker checks of the design move todocker_compat. compose_podmanchecks that/etc/containers/containers.conf.d/50-podman-outside-podman-compose.confexists. It starts two services,podman compose exec b ping -c1 -W5 amust exit 0, andpodman compose downremoves them.docker_compatchecks these items:dpkg -S /usr/bin/dockernamespodman-docker, anddpkg-queryfinds none ofdocker-cli,docker.ioanddocker-ce-cli.docker versionshows a Podman server, anddocker inforeports a remote engine.- The link target is
/run/podman/podman.sock. podman image existsfinds the image fromdocker build(one store).docker compose upstarts two services.docker compose exec b ping -c1 -W5 aexits 0.docker compose downremoves them.sudo podman-remote inforeports a remote engine.
- Change:
idempotentadds a restart case. Stop the socat proxy with SIGKILL and run the entrypoint again./run/podman/podman.sockmust beroot:dockerwith mode660, and the remote user must reach it. - Change: add a failure test of the check inside a passing scenario. Run
podman-check.shwithCONTAINER_HOST=unix:///run/missing.sock. It must exit 1 and print(!) podman-outside-podman:. A scenario that must fail to start cannot be a features test, because the CLI runs the check at launch. - Keep
rootful_proxy,foreign_uid_proxy,keepid_directandnamed_volume. In the proxy scenarios, the socat socket isroot:dockerwith mode660.named_volumeusespodman run -v <name>:/d, becausedockeris not installed by default. - Check the state of the containers and the exit status of
exec, not the exit code ofpodman-compose up. On ubuntu:noble, podman-compose 1.0.6 exits 0 when a container does not start. - The test job adds the negative exclusion step for this direction.
- The images stay debian:sid, debian:trixie and ubuntu:noble, linux/amd64 only.
Evidence (2026-11-19)
Client containers with no privilege mounted the socket directory of a rootful Podman 5.4.2 service at /run/podman-host. socat served /run/podman/podman.sock as root:docker 660, and CONTAINER_HOST named it.
-
With
podman-docker5.8.6 (debian:sid), 5.4.2 (debian:trixie) and 4.9.3 (ubuntu:noble),docker versionshowed the client and the server 5.4.2, anddocker inforeported a remote engine.docker runanddocker buildworked.podman-remote image existsfound the built image. -
After
podman-remoteandsocat,podman-dockeradded 38 packages and 131 MiB (debian:sid), 48 packages and 187 MiB (debian:trixie), and 37 packages and 105 MiB (ubuntu:noble). Afterpodman-remote,socatandpodman-compose, it added 32 packages and 128 MiB, 41 packages and 184 MiB, and 34 packages and 105 MiB. -
With only
podman-remote,socatandpodman-compose,/etc/containers/containers.conf.ddid not exist on all three images. -
sudo docker infoandsudo docker runfailed with "cannot clone: Operation not permitted" on all three images.sudo podman-remote inforeported a remote engine on all three images. -
On debian:sid, the sudo
secure_pathis/usr/sbin:/usr/bin:/sbin:/bin.sudo podman infofailed with "command not found" withoutpodman-docker, and with "cannot re-exec process" with it. On debian:trixie and ubuntu:noble, thesecure_pathstarts with/usr/local/sbin:/usr/local/bin, andsudo podman inforeported a remote engine. -
With the compose file,
podman composeanddocker composeran podman-compose (1.6.0, 1.3.0, 1.0.6). This was true withpodman-remotealone and withpodman-docker, on all three images.up, name resolution (the ping output of serviceb) anddownworked, and no ">>>>" line was printed. -
Docker Compose through
podman composefailed on ubuntu:noble with "Cannot connect to the Docker daemon at unix:///tmp/podman-run-1000/podman/podman.sock". It worked on debian:trixie. -
On debian:sid and debian:trixie, a
bashlogin shell asvscodewithXDG_RUNTIME_DIRset gotDOCKER_HOST=unix:///run/user/1000/podman/podman.sock. Root gotunix:///run/podman/podman.sock. -
Change (found in the review of PR feat: add the podman-in-podman Feature 1.0.0 #9):
test-all.yamlhas a job that installs every Feature in one container (features test -f "${ids[@]}"), andnpm testdoes the same. The mutual exclusion stops that install when both Podman Features are in it. This PR runs the combined test without one of the two Podman Features (both still run alone), and CONTRIBUTING.md says why.
Proof
test-pr.yaml on ubuntu-latest: the default test (rootful service on /run/user/1000/podman), rootful_proxy, foreign_uid_proxy and named_volume pass under Docker, and keepid_direct passes in the podman-host shim job. lint passes. The PR body states that securityOpt label=disable lowers SELinux separation and that the socket gives the full power of the host engine. Manual check on the owner's WSL host, recorded in the PR: a devcontainer with this Feature starts, and the postStart check prints 'rootless'.
Alternatives check of 2026-11-19: in-use.
The repository already uses this tool.
Tool: NerdIT-Tech/devcontainer-features (https://github.com/NerdIT-Tech/devcontainer-features), MIT, last activity 2026-10-12, maintained.
Reason: Searches found only NerdIT-Tech's podman-remote Feature, which installs the remote client and points it at a host socket the user must bind; it lacks the directory mount, proxy fallback and checks, so it covers part of the need.
Covers:
- Installs the Podman remote client
- Points the client at the host socket
- No engine process in the container
Lacks:
- No bind-mounted host socket directory
- No socat proxy fallback for foreign uid or rootful socket
- No post-start check with host fix output
- No exclusion check against podman-in-podman
Proposed design
Problem statement
Add the podman-outside-podman Dev Container Feature 1.0.0: a client-only connection to the host Podman engine through a bind-mounted API socket directory, with no engine in the container, so debian:sid users get the Podman form of docker-outside-of-docker. The Feature shares scripts/podman-common.sh and the entrypoint/check contract with podman-in-podman (#5, PR #9), which must merge first, and it also depends on #3. CI proves the container paths; the owner's manual WSL host check stays a person gate before merge.
Acceptance criteria
Requirement: Host socket mount and environment
The Feature metadata SHALL bind the host Podman socket directory at /run/podman-host and SHALL set only CONTAINER_HOST in containerEnv.
Scenario: Default mount and environment
- WHEN the default test runs
npx devcontainer features test --skip-scenarios -f podman-outside-podman -i debian:sid . - THEN the test passes, /run/podman-host is a bind mount, CONTAINER_HOST is unix:///run/podman/podman.sock, and DOCKER_HOST and DOCKER_BUILDKIT are not set.
Requirement: Metadata schema validity
The Feature metadata MUST pass the repository's devcontainer-feature.json schema validation.
Scenario: Metadata schema
- WHEN the
Validate devcontainer-feature.json filesworkflow runs on the pull request - THEN the
devcontainers/actionstep withvalidate-only: "true"andbase-path-to-features: ./srcpasses for src/podman-outside-podman/devcontainer-feature.json.
Requirement: Runtime script paths
The Feature metadata MUST set entrypoint to /usr/local/share/podman-init.sh and postStartCommand to /usr/local/share/podman-check.sh.
Scenario: Default runtime scripts
- WHEN the default test runs
- THEN the test passes, /run/podman-outside-podman/ready exists, and
/usr/local/share/podman-check.shexits 0.
Requirement: Default package set
The install script SHALL install podman-remote, socat and the default podman-compose from the distribution archive with --no-install-recommends, and SHALL leave docker, docker-compose and /var/run/docker.sock out with the default options.
Scenario: Default packages
- WHEN the default test runs
- THEN
podman-remote --version,socat -Vandpodman-compose --versionsucceed,podmanresolves to /usr/bin/podman-remote, anddocker,docker-composeand /var/run/docker.sock are absent.
Requirement: Feature exclusion
The install script MUST stop with a clear error when the podman-in-podman marker directory exists.
Scenario: Podman-in-podman marker
- WHEN the test creates /usr/local/share/podman-in-podman and runs
src/podman-outside-podman/install.sh - THEN the script exits non-zero and prints
(!) podman-in-podman and podman-outside-podman cannot be in one container.
Requirement: Direct socket path
The entrypoint MUST link the host socket directly when the remote user can write to it.
Scenario: keep-id direct socket
- WHEN the keepid_direct scenario runs with the Podman shim and keep-id
- THEN no socat process runs, /run/podman/podman.sock links to /run/podman-host/podman.sock, and
runuser -u vscode -- podman --remote infosucceeds.
Requirement: Proxy socket path
The entrypoint MUST start a socat proxy when the remote user cannot write to the host socket.
Scenario: Rootful proxy
- WHEN the rootful_proxy scenario runs with a root-owned 0660 socket
- THEN socat listens on /run/podman/podman.sock as root:docker with mode 660, and
runuser -u vscode -- podman --remote infosucceeds.
Requirement: Stale socket and restart
The entrypoint MUST remove a stale /run/podman/podman.sock and MUST restore the proxy after a restart.
Scenario: Restart after SIGKILL
- WHEN the idempotent scenario stops the socat proxy with SIGKILL and runs the entrypoint again
- THEN /run/podman/podman.sock is root:docker with mode 660 and
runuser -u vscode -- podman --remote infosucceeds.
Requirement: Post-start check success
The post-start check SHALL print one line that starts with podman-outside-podman: and names the host engine mode.
Scenario: Rootful host check
- WHEN the rootful_proxy scenario runs
/usr/local/share/podman-check.sh - THEN the script exits 0 and prints a line that starts with
podman-outside-podman:and namesrootful.
Requirement: Post-start check failure
The post-start check MUST exit non-zero with the host fix when the socket is unreachable.
Scenario: Unreachable host socket
- WHEN
/usr/local/share/podman-check.shruns with CONTAINER_HOST=unix:///run/missing.sock - THEN the script exits 1 and prints
(!) podman-outside-podman:and the host fix commands.
Requirement: Named volume sharing
The Feature MUST let a named Podman volume be shared by name between the host engine and the container.
Scenario: Named volume
- WHEN the named_volume scenario runs with dockerCompat=true
- THEN
podman volume createon the host anddocker run -v <name>:/din the container share data.
Requirement: Docker compatibility switch
The install script MUST omit docker-cli, docker-compose and the /var/run/docker.sock link when dockerCompat is false and compose is not docker-compose.
Scenario: Docker compatibility off
- WHEN the docker_compat_off scenario runs
- THEN podman-remote, socat and podman-compose are installed,
docker,docker-composeand /var/run/docker.sock are absent, andpodman --remote infosucceeds.
Requirement: Compose option
The install script MUST install the compose tool that the compose option names.
Scenario: Docker Compose option
- WHEN the compose_docker scenario runs with compose=docker-compose and dockerCompat=true
- THEN
docker compose versionsucceeds,docker versionshows a Podman server, /var/run/docker.sock links to /run/podman/podman.sock, and a classicdocker buildleaves the image in the host store.
Requirement: Docker-in-docker compatibility
The install script MUST skip dockerCompat and compose=docker-compose when /usr/local/share/docker-init.sh exists.
Scenario: With docker-in-docker
- WHEN the with_docker_in_docker scenario runs
- THEN DOCKER_BUILDKIT is 1 and
docker inforeaches the in-container dockerd.
Requirement: Minimal option
The install script MUST install only podman-remote and socat when compose is none and dockerCompat is false.
Scenario: Minimal install
- WHEN the minimal scenario runs with compose=none and dockerCompat=false
- THEN podman-remote and socat are installed, and
podman-compose,dockeranddocker-composeare absent.
Requirement: Shared file identity
The Feature SHALL source a byte-for-byte copy of scripts/podman-common.sh from podman-in-podman.
Scenario: Shared file compare
- WHEN the
Lintworkflow in.github/workflows/lint.yamlruns on the pull request - THEN the
cmp src/podman-in-podman/scripts/podman-common.sh src/podman-outside-podman/scripts/podman-common.shstep passes.
Requirement: Feature documentation
The pull request SHALL commit the generated src/podman-outside-podman/README.md and SHALL add the Feature row to the Features table of README.md.
Scenario: Docs check
- WHEN the
Lintworkflow in.github/workflows/lint.yamlruns on the pull request - THEN the
npm run docsstep passes with no diff undersrc/*/README.md.
Requirement: Shell script lint
The Feature shell scripts MUST pass the repository's shell linter at its default severity.
Scenario: Shell linter
- WHEN the
Lintworkflow in.github/workflows/lint.yamlruns on the pull request - THEN
git ls-files -z '*.sh' | xargs -0r shellcheckpasses with no findings for src/podman-outside-podman/*.sh.
Requirement: CI host services and image matrix
The test workflow SHALL start the runner's Podman services and SHALL test on debian:sid, debian:trixie and ubuntu:noble on linux/amd64.
Scenario: Test workflow
- WHEN the
PR - Test Updated Featuresworkflow runs on the pull request - THEN the test job starts the rootful Podman service on /run/user/1000/podman and the scenario job starts the rootless service, and the default, rootful_proxy, foreign_uid_proxy, keepid_direct and named_volume tests pass on debian:sid, debian:trixie and ubuntu:noble.
Existing Tool Considered
NerdIT-Tech/devcontainer-features (https://github.com/NerdIT-Tech/devcontainer-features) is the open, maintained tool that the alternatives check found; the block of that check (2026-11-19, verdict partly) records what the tool lacks. This Feature builds those missing parts in this repository: install.sh, the entrypoint, the check script and the tests. Written cost: about 12,000 tokens to build, about 3,000 tokens per fix, and about 2 days elapsed.
Key questions
-
Where does the rootless Podman API socket live, and which path do clients use?: The
podman.socketsystemd unit listens onListenStream=%t/podman/podman.sock, which is$XDG_RUNTIME_DIR/podman/podman.sock(/run/user/1000/podman/podman.sockfor uid 1000), and clients such as docker-compose reach it withDOCKER_HOST=unix://$XDG_RUNTIME_DIR/podman/podman.sock(fetched 2026-11-19). The unit also setsSocketMode=0660, and the page showssystemctl --user start podman.socketandloginctl enable-linger $USER. [sources: https://github.com/podman-container-tools/podman/blob/main/docs/tutorials/socket_activation.md] -
Should the host socket be mounted as a directory or as a file?: Mount the host socket directory at /run/podman-host, with the default source
${localEnv:XDG_RUNTIME_DIR:/run/user/1000}/podmanand the client socket /run/podman/podman.sock. Systemd owns and recreates%t/podman/podman.sockinside that directory, so a directory bind follows the new socket, while a file bind keeps the old inode. (best practice) [sources: https://github.com/podman-container-tools/podman/blob/main/docs/tutorials/socket_activation.md]- Chosen: Bind the host socket directory at /run/podman-host. The socket is
%t/podman/podman.sock, and systemd creates it again in the same directory, so the bind stays valid. - Rejected: Bind the socket file at /tmp/podman.sock. A file bind keeps the old inode after the host makes the socket again, as the NerdIT-Tech Feature does.
- Chosen: Bind the host socket directory at /run/podman-host. The socket is
-
Which open, maintained tool or library covers the need?: NerdIT-Tech/devcontainer-features (podman-remote) is the only open, maintained tool the alternatives check found, and its verdict is
partly; the check'sblocklists what it lacks. This Feature builds those missing parts here and sharesscripts/podman-common.shwith podman-in-podman. docker-outside-of-docker is not an option because the project records that it stops onforkyon debian:sid. (best practice) [sources: README.md:39, README.md:7]- Chosen: Build the missing parts in this repository. The only maintained tool covers part of the need, so the project builds the rest and can share the common script with podman-in-podman.
- Rejected: Use NerdIT-Tech/devcontainer-features podman-remote. The
blockof the alternatives check records what it lacks, so it covers only part of the need. - Rejected: Use docker-outside-of-docker. README.md:7 and README.md:39 record that it does not install on debian:sid because the Docker apt repository has no
forkyorsidsuite.
-
Which options, packages and environment variables should the Feature set?:
dockerCompatdefaults to false and installs the Docker CLI only;composetakespodman-compose,docker-composeornoneand defaults topodman-compose. Packages come from the Debian archive with--no-install-recommendsand no version pins: podman-remote, socat and the chosen compose tool. containerEnv sets onlyCONTAINER_HOST=unix:///run/podman/podman.sock. It sets noDOCKER_HOST, because the socket activation page gives that variable as an explicit per-shell export, and noDOCKER_BUILDKIT=0, because Docker documents that value as opting into the deprecated legacy builder. (best practice) [sources: CONTRIBUTING.md:8, https://github.com/podman-container-tools/podman/blob/main/docs/tutorials/socket_activation.md, https://docs.docker.com/reference/cli/docker/image/build]- Chosen: dockerCompat off by default, compose=podman-compose by default, only CONTAINER_HOST in containerEnv. The default install needs no Docker CLI, the packages stay in the Debian archive without pins (CONTRIBUTING.md:8), and CONTAINER_HOST is the only variable the client needs.
- Rejected: dockerCompat on by default with docker-cli and docker-compose. On ubuntu:noble the only provider of docker-cli is docker.io, which also pulls dockerd and containerd, and the classic builder that Podman's API serves is documented as deprecated.
- Rejected: Set DOCKER_HOST and DOCKER_BUILDKIT=0 in containerEnv. The tools use /var/run/docker.sock, and DOCKER_BUILDKIT=0 would also apply to a docker-in-docker install in the same container.
-
Which base images and platform should the tests use?: debian:sid, debian:trixie and ubuntu:noble on linux/amd64, as the owner decided on 2026-11-19. The image list of the
testjob in.github/workflows/test-pr.yamlis where the matrix is set; it holds["debian:sid"]today. (best practice) [sources: .github/workflows/test-pr.yaml:60]- Chosen: debian:sid, debian:trixie and ubuntu:noble on linux/amd64. The owner chose these images and the amd64 platform.
- Rejected: Add arm64 or other distributions. The owner limited the tests to linux/amd64 and these three images.
-
Should the Feature set privileged, capAdd, init or dependsOn?: No. The API is a Unix socket file with
SocketMode=0660inside the mounted directory, so the directory bind plus the write permission of the remote user is the access. The metadata sets the mount,securityOpt: ["label=disable"], the entrypoint andinstallsAftercommon-utils, docker-in-docker and docker-outside-of-docker. podman-in-podman leavesinstallsAfterbecause both Features check each other's marker. init and dependsOn add nothing: the entrypoint starts the proxy, and installsAfter orders the install. (best practice) [sources: https://github.com/podman-container-tools/podman/blob/main/docs/tutorials/socket_activation.md]- Chosen: Set only the socket directory mount and securityOpt. A Unix socket with mode 0660 in a mounted directory needs no extra capability and no init process.
- Rejected: Set privileged or capAdd. These options give more power than a socket directory mount needs.
- Rejected: Set init or dependsOn. The entrypoint starts socat itself, and installsAfter already orders the install.
-
How should the Feature handle a missing default socket directory?: Keep the default source
${localEnv:XDG_RUNTIME_DIR:/run/user/1000}/podmanand document the override in NOTES.md:/run/user/<uid>/podmanfor another uid and/run/podmanfor a rootful host. The README also gives theinitializeCommandthat starts the socket before the container, because the socket only exists aftersystemctl --user start podman.socket. (best practice) [sources: https://github.com/podman-container-tools/podman/blob/main/docs/tutorials/socket_activation.md]- Chosen: Keep the default mount and document the override and initializeCommand. The default follows the documented rootless socket path, and the README shows the host setup that creates it.
- Rejected: Create the directory at image build. The image build cannot create a host path, and the mount source is on the host.
-
Should the Feature copy the shared
scripts/podman-common.shfrom podman-in-podman?: Yes, after feat(podman-in-podman): add the podman-in-podman Feature 1.0.0 #5 merges. At this commit the repository has nosrc/tree and no Feature is published, so the file does not exist yet; this pull request copies it byte for byte, sources it from install.sh, and adds thecmpstep to the lint workflow. Neither Feature changes the copy alone. (best practice) [sources: README.md:16, README.md:12, .github/workflows/lint.yaml:28]- Chosen: Copy the shared file byte for byte and source it. Both Features follow one contract, and the lint workflow compares the two copies.
- Rejected: Write a separate install script for this Feature. It would duplicate the contract and let the two Features diverge.
-
How should the entrypoint test whether the remote user can reach the host socket?: Use
runuser -u <user> -- test -w /run/podman-host/podman.sock, so the entrypoint makes no API call. A connect on a Unix socket needs write permission, and the socket unit setsSocketMode=0660, so the test makes the same check as a connect. (best practice) [sources: https://github.com/podman-container-tools/podman/blob/main/docs/tutorials/socket_activation.md]- Chosen: Test write access with
test -w. The check is local and makes the same permission test as a connect, so the entrypoint makes no API call. - Rejected: Call
podman-remote --url ... info. It makes an API call from the entrypoint and can start the host service as a side effect.
- Chosen: Test write access with
-
Who performs the manual WSL host check?: The owner (dan-petty) runs the manual check on the WSL host and records the result in the pull request before merge: the devcontainer with the Feature starts, and the postStart check prints
rootless. (a person decides)
Open questions
- Who performs the manual WSL host check? (a person decides)
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 19, 2026
podman-outside-podman, and .github/labels.yml declares no scope/podman-outside-podman label. Add the label to the file to give the scope to this item.Both add a Podman Dev Container Feature 1.0.0, but #5 runs an engine inside the container while the candidate mounts the host socket for a client-only connection.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
devops-cli-service commentedon Nov 19, 2026
The result in the alternatives block of the issue body changed. Before this check:
partly, tool https://github.com/NerdIT-Tech/devcontainer-features. A person decides what the new result means for the item.Searches (10)
Tools considered:
Searches run:
Sources: