Skip to content

feat(podman-outside-podman): add the podman-outside-podman Feature 1.0.0 #6

Closed

Description

@dan-petty

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:

  1. 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.
  2. 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/.
  3. rm -rf /var/lib/apt/lists/*, apt-get update, then apt-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.
  4. If /usr/bin/podman does not exist, link /usr/local/bin/podman to /usr/bin/podman-remote.
  5. 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.
  6. 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 info works, 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.sock detached. 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 run podman info, and the check prints 'rootful'.
  • foreign_uid_proxy: a workflow step starts the runner user's rootless podman system service --time=0 on /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 docker shim 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 create and docker run -v <name>:/d share 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 dockerCompat is false, the same as in podman-in-podman. dockerCompat installs podman-docker and makes the /var/run/docker.sock link.
  • Change: add compose (podman-compose or none, default podman-compose), the same as in podman-in-podman. With --no-install-recommends, podman-compose needs only Python packages. It runs the podman command, which is podman-remote here.
  • Add no buildah or skopeo option. These tools work on local storage, not through the API.

The docker command

  • Change: dockerCompat installs podman-docker, not docker-cli and docker-compose. Use apt-get install -y --no-install-recommends podman-docker through the shared file. Remove the design text "Do not use podman-docker, which pulls in the full engine".
  • podman-docker depends on podman. With the default compose=podman-compose, it adds 32 to 41 packages and 105 to 184 MiB. With compose=none, it adds 37 to 48 packages and 105 to 187 MiB. No engine process runs. NOTES.md gives the size.
  • The docker of the package runs /usr/bin/podman. CONTAINER_HOST makes that binary remote. Thus docker uses the host engine, and docker version shows the client and the Podman server of the host.
  • Change: always link /usr/local/bin/podman to /usr/bin/podman-remote. The design makes the link only when /usr/bin/podman is missing, but podman-docker installs /usr/bin/podman. With the link, podman on the PATH of the remote user is podman-remote, with or without podman-docker. Without podman-docker, the link is the only podman command, and podman-compose needs it.
  • sudo removes CONTAINER_HOST from the environment. Thus sudo docker runs /usr/bin/podman as a local engine, and it fails with "cannot clone: Operation not permitted". sudo podman also fails on debian:sid. The sudo secure_path there has no /usr/local/bin, so sudo podman does not find the link. It runs /usr/bin/podman when podman-docker is installed, and it finds no podman when it is not. sudo podman-remote works on all three images. It uses its root default unix:///run/podman/podman.sock, which is the client socket.
  • NOTES.md says: sudo docker fails, and sudo podman can fail. Run docker as the remote user, who is in the group docker, or run sudo podman-remote. The Feature does not change the sudo policy.
  • Keep touch /etc/containers/nodocker. The shared function first runs mkdir -p /etc/containers.
  • Skip dockerCompat with the rule of podman-in-podman. Skip it when /usr/local/share/docker-init.sh exists, or when a docker command on the PATH does not come from podman-docker. podman-docker conflicts with docker-cli, docker.io and docker-ce-cli, and apt-get install -y podman-docker removes docker-cli.
  • Change: docker build runs podman build through the API of the host. Remove the BuildKit text of the design: the dockerCompat row ("keeps docker-buildx out", "404 on POST /session"), the decision on docker-cli and the Risk sentence on BuildKit.

Compose

  • compose=podman-compose installs podman-compose. It also runs mkdir -p /etc/containers/containers.conf.d and 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"] and compose_warning_logs = false in [engine]. The mkdir is necessary: with dockerCompat=false, the client has only podman-remote, socat and podman-compose, and these packages do not make the directory.
  • Then docker compose, podman compose and podman-compose all run podman-compose. It uses the host engine through CONTAINER_HOST.
  • Change: install no docker-compose. Through podman compose, Docker Compose fails on ubuntu:noble. Podman 4.9.3 gives it the local default unix:///tmp/podman-run-1000/podman/podman.sock, not the CONTAINER_HOST value. In podman-in-podman, Docker Compose fails on the rootless socket. Thus both Features remove the value.
  • compose=none installs 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.socket listens on %t/podman/podman.sock) and the root default of podman-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 with podman-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. /run is 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.sock is a link to the host socket. If not, socat listens on /run/podman/podman.sock with user=root,group=docker,mode=660.
  • Change: install.sh makes the system group docker when it is missing and adds the remote user. The socat proxy needs the group also when dockerCompat is false.
  • Change: /var/run/docker.sock is a link to /run/podman/podman.sock only when dockerCompat is active. The tmpfiles.d rule of podman-docker names the same link, but no image has systemd-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.sock by default, as in both upstream Docker Features. With dockerCompat=false, that link does not exist, and only clients that read CONTAINER_HOST reach the host engine. NOTES.md says so.
  • Change: remove DOCKER_BUILDKIT=0. No Docker CLI reads it. The CLI writes containerEnv as Dockerfile ENV lines in install order, so the value would also turn BuildKit off for the dockerd of docker-in-docker.
  • NOTES.md names /etc/profile.d/podman-docker.sh and /etc/profile.d/podman-docker.csh of the Debian package, as in podman-in-podman. A login shell that reads them sets DOCKER_HOST when it is not set. For root, the value is the client socket unix:///run/podman/podman.sock. For another user with XDG_RUNTIME_DIR, the value is a path where no socket is. Such a user sets DOCKER_HOST=unix:///var/run/docker.sock in remoteEnv. The ubuntu:noble package has no such files.

Entrypoint, ready marker and check

  • Change: the entrypoint is /usr/local/share/podman-init.sh, not podman-outside-init.sh. podman-in-podman uses the same path. The pattern is the same: POSIX sh, run as root (through sudo -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>/cmdline is socat. Do not use kill -0 alone. After a restart, the old PID can belong to a different process.
  • Change: use "postStartCommand": "/usr/local/share/podman-check.sh", not podman-outside-check.sh. The form is the same as in podman-in-podman. The script waits up to 60 seconds for ready and runs podman info as the remote user, through CONTAINER_HOST. When the config records the /var/run/docker.sock link, it also runs podman --url unix:///var/run/docker.sock info. It prints one line that starts with podman-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 postStartCommand and postAttachCommand of the user. NOTES.md (Start of the container) says so. The initializeCommand in the README starts podman.socket before 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: installsAfter is common-utils, docker-in-docker and docker-outside-of-docker, the same list as in podman-in-podman.

Shared file

  • Copy scripts/podman-common.sh from podman-in-podman byte for byte. Source it from install.sh, with # shellcheck source=SCRIPTDIR/scripts/podman-common.sh on the line above. Do not change it in one Feature only.
  • The file holds the install frame, the exclusion check, the marker directory, the dockerCompat skip, the podman-docker install with mkdir -p /etc/containers and /etc/containers/nodocker, the docker group, and the podman-compose install with mkdir -p /etc/containers/containers.conf.d and 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-docker and no Docker CLI or BuildKit. It names what docker runs, the size of the podman package for each compose value, the sudo note, the skip rule, /var/run/docker.sock, /run/podman/podman.sock, the docker group, 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_docker and idempotent. with_docker_in_docker uses the same Dockerfile as podman-in-podman.
  • Change: test.sh checks the new defaults. podman-remote and podman-compose are present. podman resolves to /usr/local/bin/podman, a link to podman-remote. docker, podman-docker and /var/run/docker.sock are absent. CONTAINER_HOST is set, and DOCKER_HOST and DOCKER_BUILDKIT are not set. podman compose version names podman-compose. The check script exits 0. The Docker checks of the design move to docker_compat.
  • compose_podman checks that /etc/containers/containers.conf.d/50-podman-outside-podman-compose.conf exists. It starts two services, podman compose exec b ping -c1 -W5 a must exit 0, and podman compose down removes them.
  • docker_compat checks these items:
    • dpkg -S /usr/bin/docker names podman-docker, and dpkg-query finds none of docker-cli, docker.io and docker-ce-cli.
    • docker version shows a Podman server, and docker info reports a remote engine.
    • The link target is /run/podman/podman.sock.
    • podman image exists finds the image from docker build (one store).
    • docker compose up starts two services. docker compose exec b ping -c1 -W5 a exits 0. docker compose down removes them.
    • sudo podman-remote info reports a remote engine.
  • Change: idempotent adds a restart case. Stop the socat proxy with SIGKILL and run the entrypoint again. /run/podman/podman.sock must be root:docker with mode 660, and the remote user must reach it.
  • Change: add a failure test of the check inside a passing scenario. Run podman-check.sh with CONTAINER_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_direct and named_volume. In the proxy scenarios, the socat socket is root:docker with mode 660. named_volume uses podman run -v <name>:/d, because docker is not installed by default.
  • Check the state of the containers and the exit status of exec, not the exit code of podman-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-docker 5.8.6 (debian:sid), 5.4.2 (debian:trixie) and 4.9.3 (ubuntu:noble), docker version showed the client and the server 5.4.2, and docker info reported a remote engine. docker run and docker build worked. podman-remote image exists found the built image.

  • After podman-remote and socat, podman-docker added 38 packages and 131 MiB (debian:sid), 48 packages and 187 MiB (debian:trixie), and 37 packages and 105 MiB (ubuntu:noble). After podman-remote, socat and podman-compose, it added 32 packages and 128 MiB, 41 packages and 184 MiB, and 34 packages and 105 MiB.

  • With only podman-remote, socat and podman-compose, /etc/containers/containers.conf.d did not exist on all three images.

  • sudo docker info and sudo docker run failed with "cannot clone: Operation not permitted" on all three images. sudo podman-remote info reported a remote engine on all three images.

  • On debian:sid, the sudo secure_path is /usr/sbin:/usr/bin:/sbin:/bin. sudo podman info failed with "command not found" without podman-docker, and with "cannot re-exec process" with it. On debian:trixie and ubuntu:noble, the secure_path starts with /usr/local/sbin:/usr/local/bin, and sudo podman info reported a remote engine.

  • With the compose file, podman compose and docker compose ran podman-compose (1.6.0, 1.3.0, 1.0.6). This was true with podman-remote alone and with podman-docker, on all three images. up, name resolution (the ping output of service b) and down worked, and no ">>>>" line was printed.

  • Docker Compose through podman compose failed 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 bash login shell as vscode with XDG_RUNTIME_DIR set got DOCKER_HOST=unix:///run/user/1000/podman/podman.sock. Root got unix:///run/podman/podman.sock.

  • Change (found in the review of PR feat: add the podman-in-podman Feature 1.0.0 #9): test-all.yaml has a job that installs every Feature in one container (features test -f "${ids[@]}"), and npm test does 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'.

Depends on: #3, #5

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 files workflow runs on the pull request
  • THEN the devcontainers/action step with validate-only: "true" and base-path-to-features: ./src passes 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.sh exits 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 -V and podman-compose --version succeed, podman resolves to /usr/bin/podman-remote, and docker, docker-compose and /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 info succeeds.

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 info succeeds.

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 info succeeds.

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 names rootful.

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.sh runs 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 create on the host and docker run -v <name>:/d in 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-compose and /var/run/docker.sock are absent, and podman --remote info succeeds.

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 version succeeds, docker version shows a Podman server, /var/run/docker.sock links to /run/podman/podman.sock, and a classic docker build leaves 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 info reaches 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, docker and docker-compose are 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 Lint workflow in .github/workflows/lint.yaml runs on the pull request
  • THEN the cmp src/podman-in-podman/scripts/podman-common.sh src/podman-outside-podman/scripts/podman-common.sh step 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 Lint workflow in .github/workflows/lint.yaml runs on the pull request
  • THEN the npm run docs step passes with no diff under src/*/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 Lint workflow in .github/workflows/lint.yaml runs on the pull request
  • THEN git ls-files -z '*.sh' | xargs -0r shellcheck passes 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 Features workflow 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.socket systemd unit listens on ListenStream=%t/podman/podman.sock, which is $XDG_RUNTIME_DIR/podman/podman.sock (/run/user/1000/podman/podman.sock for uid 1000), and clients such as docker-compose reach it with DOCKER_HOST=unix://$XDG_RUNTIME_DIR/podman/podman.sock (fetched 2026-11-19). The unit also sets SocketMode=0660, and the page shows systemctl --user start podman.socket and loginctl 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}/podman and the client socket /run/podman/podman.sock. Systemd owns and recreates %t/podman/podman.sock inside 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.
  • 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's block lists what it lacks. This Feature builds those missing parts here and shares scripts/podman-common.sh with podman-in-podman. docker-outside-of-docker is not an option because the project records that it stops on forky on 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 block of 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 forky or sid suite.
  • Which options, packages and environment variables should the Feature set?: dockerCompat defaults to false and installs the Docker CLI only; compose takes podman-compose, docker-compose or none and defaults to podman-compose. Packages come from the Debian archive with --no-install-recommends and no version pins: podman-remote, socat and the chosen compose tool. containerEnv sets only CONTAINER_HOST=unix:///run/podman/podman.sock. It sets no DOCKER_HOST, because the socket activation page gives that variable as an explicit per-shell export, and no DOCKER_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 test job in .github/workflows/test-pr.yaml is 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=0660 inside 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 and installsAfter common-utils, docker-in-docker and docker-outside-of-docker. podman-in-podman leaves installsAfter because 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}/podman and document the override in NOTES.md: /run/user/<uid>/podman for another uid and /run/podman for a rootful host. The README also gives the initializeCommand that starts the socket before the container, because the socket only exists after systemctl --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.sh from 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 no src/ 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 the cmp step 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 sets SocketMode=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.
  • 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.

Dependencies

#3, #5

Activity

  1. dan-petty commented on Nov 19, 2026

    @dan-petty
    OwnerAuthor
    • Scope: none. The title has the scope 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.
    • Related: feat(podman-in-podman): add the podman-in-podman Feature 1.0.0 #5, which asks for a different change. 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.
  2. added
    type/feature
    source/agent
    status/new
    value/medium
    effort/medium
    priority/p2-medium
    on Nov 19, 2026
  3. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    Contributor

    Owner question: See the first point of Open questions in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  4. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    Contributor

    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:

    • "podman-remote" devcontainer feature GitHub, results: 5
    • devcontainer feature Podman remote host socket outside of podman, results: 5
    • podman outside of podman devcontainer-feature, results: 5
    • NerdIT-Tech podman-remote devcontainer-feature, results: 5
    • github podman remote devcontainer feature, results: 5
    • devcontainer feature podman.sock, results: 5
    • "NerdIT-Tech" "podman", results: 5
    • site:github.com/NerdIT-Tech podman, results: 5
    • podman devcontainer, results: 5
    • containers.dev features podman, results: 5

    Sources:

  5. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    Contributor

    Owner question: See the first point of Open questions in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

  6. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    Contributor

    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:

    • NerdIT-Tech devcontainer-features podman-remote, results: 5
    • devcontainer feature podman host socket client podman-remote, results: 5
    • podman socket devcontainer feature github "podman-remote", results: 5
    • "podman-outside-of" podman dev container feature github, results: 5
    • containers.dev features podman, results: 5
    • podman outside of docker devcontainer feature, results: 5
    • NerdIT-Tech devcontainer-features, results: 5
    • docker-outside-of-docker devcontainers feature, results: 5
    • podman devcontainer, results: 5
    • site:github.com podman devcontainer feature socket, results: 5

    Sources:

  7. added
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 19, 2026
  8. removed
    status/in-review
    on Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumsource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions