Skip to content

[Feature]: document and test rootless Podman as the docker-isolation backend (alternative to mounting the host Docker socket) #1705

Closed

Description

@james-crowley

Problem / motivation

docker isolation needs a Docker daemon, and Spec 111 (FR-022, D10) documents one way to supply it from a container: mount the host /var/run/docker.sock, which the spec itself calls root-equivalent control of the host. On a Linux server the same isolation can be had without that, using a rootless Podman API socket, but this is not documented or tested anywhere.

I tested it and it works with no code change. Setup on Ubuntu, Podman 5.7.0, the stock docker CLI 29.9.1, mcpproxy built from main (3558c53):

systemctl --user enable --now podman.socket          # or: podman system service --time=0 unix:///path/podman.sock
export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/podman/podman.sock
mcpproxy serve ...                                   # config: "docker_isolation": {"mode": "docker"}

Results:

  • docker info --format '{{.ServerVersion}}' against the Podman socket returns 5.7.0, so the availability probe passes.
  • mcpproxy direct-execs /usr/bin/docker ("Docker spawn: direct-exec of resolved docker binary") and the child ran in a container created by Podman from the default python isolation image (ghcr.io/astral-sh/uv:python3.13-bookworm-slim).
  • In that container the proxy's data directory is not visible, the container's loopback is not the host's (a connect to the proxy's listener is refused), only the image's own environment is present, and the process is uid 0 inside the container, which maps to the unprivileged host user.
  • DOCKER_HOST has to be in mcpproxy's own environment (a systemd Environment= line, or environment: in compose); docs/docker-isolation.md already notes that it is read from there. When the Podman service was not running, the spawn failed with Cannot connect to the Docker daemon at unix:///..., which is the right message.

I did not test the other route (the podman-docker shim that makes docker an alias for podman), or running mcpproxy inside a container with the Podman socket mounted.

Why it matters beyond my setup: with rootless Podman the blast radius of a compromised proxy is one unprivileged Linux user, not the host. It also gives stdio servers a real isolation boundary without Docker Desktop or a root daemon, which is what headless Linux users (153 long-lived installs in the Spec 111 numbers) have.

Proposed solution

Documentation only, plus one test if you want it:

  • Add a "Rootless Podman" section to docs/docker-isolation.md with the three lines above and the DOCKER_HOST caveat.
  • In Spec 111 FR-022/FR-023, list the rootless Podman socket as an alternative to mounting the host Docker socket, next to the existing warning.
  • Optionally make the isolation status message say when the daemon in use is Podman (docker info reports it), which helps support requests.

Alternatives considered

  • Docker-in-Docker: rejected already in D10 (privileged container).
  • A socket proxy that filters the Docker API (for example tecnativa/docker-socket-proxy): restricts which API calls the proxy can make, but still talks to a root daemon. I did not test it.
  • sandbox mode: runs without Docker, but it does not stop reads of the data directory (see the separate issue about stdio children reading /data).

Which edition?

Both (personal and server).

  • I searched existing issues and discussions for a similar request (searched Podman, rootless, DOCKER_HOST, isolation socket; nothing found; related: Spec 111 D10/D20, docs/docker-isolation.md)

Activity

  1. james-crowley commented on Oct 20, 2026

    @james-crowley
    ContributorAuthor

    Related: #1704 (stdio children can read the data directory), #1707 (compose example).

  2. Dumbris commented on Oct 20, 2026

    @Dumbris
    Member

    Nice, and it makes sense that it just works since we only shell out to the docker CLI. Your test ran mcpproxy on the host with the Podman socket. Do you plan to run it inside a container with the socket mounted, which is the case the Spec 111 warning is about? If you do, could you note what socket permissions and user mapping it needed, so we can document that route too and not only the host-run one?

  3. james-crowley commented on Oct 20, 2026

    @james-crowley
    ContributorAuthor

    Yes, tested in a container too. The proxy ran in docker.io/library/docker:cli (it has the static docker CLI and sh), as a rootless Podman container (Podman 5.7.0), with the user-level socket bind-mounted (systemctl --user start podman.socket gives /run/user/<uid>/podman/podman.sock, mode 660, owned by the host user) and DOCKER_HOST=unix:///run/podman.sock.

    Socket access from inside the proxy container, by user mapping:

    Container user Result
    default (root in the container = the host user) works, docker info returns 5.7.0
    --user 65532:65532 fails: the socket appears as 0:0 mode 660 inside, and 65532 has no access
    --userns=keep-id --user <host uid>:<host uid> works
    --user 65532:65532 --group-add keep-groups works (passes the host's supplementary groups through crun)

    The docker group_add: [<gid>] advice in D20 does not carry over: with rootless Podman the usable fixes are keep-id, keep-groups, or running the container as its root.

    With the keep-id variant the proxy spawned a python isolation container as a sibling (through the socket). The child ran as uid 0 inside its own container, saw no /data and no socket, and its environment held only the image's own variables. Notes for the docs:

    • -v paths in docker_isolation.extra_args are resolved on the host, not inside the proxy container.
    • With a non-root user and no $HOME the proxy logged mkdir /.local: permission denied for its HTTP log; setting HOME to a writable path fixes that.
    • The socket is the user's, not root's, so a compromised proxy can start containers as that one user and nothing else.
  4. Dumbris commented on Oct 21, 2026

    @Dumbris
    Member

    Perfect, that matrix is what the docs needed, and the keep-id / keep-groups difference from the Docker group_add advice is exactly the trap people would hit. We will document both routes (host-run and in-container) as community-verified with your notes on -v paths, HOME and the user-owned socket, without a CI job for now.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions