Migrating from Docker to Podman in DevContainers
You're moving off Docker Desktop to rootless Podman and want your devcontainers to come along. This page migrates in place: point the tooling at Podman, add the keep-id mapping, and handle the two rootless differences — low ports and the Compose provider — so the same .devcontainer/ runs on Podman.
Prerequisites
You need rootless Podman installed and your existing devcontainer config.
- Rootless Podman working (
podman info). - Your existing
.devcontainer/config. - podman-compose if you use multi-service stacks.
Step-by-Step Implementation
- Point the tooling at Podman.
"dev.containers.dockerPath": "podman"
"dev.containers.dockerComposePath": "podman-compose"
- Add the userns mapping so file ownership stays correct.
{ "runArgs": ["--userns=keep-id"], "remoteUser": "vscode" }
- Raise any low ports above 1024.
{ "forwardPorts": [8080] }
- Verify the same config builds and attaches on Podman.
devcontainer up --workspace-folder .
Common Pitfalls
Migration snags are ownership, low ports, or the Compose provider.
| Symptom | Root Cause | Remediation |
|---|---|---|
| Tooling still calls docker | dockerPath not set | Set dev.containers.dockerPath to podman |
| Files root/subuid-owned | No keep-id | Add --userns=keep-id |
| Low port fails to bind | Rootless can't bind <1024 | Forward a port above 1024 |
| Compose stack fails | Docker compose assumed | Set dockerComposePath to podman-compose |
Conclusion
Migrating to Podman is mostly configuration: point the tooling at podman, add keep-id for ownership, raise low ports, and set the Compose provider. The .devcontainer/ itself barely changes, so the same environment runs rootless with a smaller attack surface.
FAQ
Will my Dockerfile and Features work on Podman?
Yes — Podman builds OCI images and consumes Features the same way. The base image, Features, and lifecycle hooks are unchanged; you only adjust the engine path, add keep-id, and handle rootless ports and the Compose provider.
What breaks most often in the switch?
File ownership (fixed with --userns=keep-id) and low ports (rootless can't bind below 1024). Address those two and most migrations are seamless. Multi-service stacks additionally need the compose provider pointed at podman-compose.
Can Docker and Podman coexist during migration?
Yes. You can point the tooling at either engine, so team members can migrate individually. Keep the config host-agnostic (no engine-specific paths baked in) and the same .devcontainer/ works on both while you transition.
Related
- Up to Podman & Rootless Container Engines — the overview of rootless engines.
- Mapping UIDs for Rootless Podman DevContainers — the ownership detail.
- Using VS Code Remote Containers without Docker Desktop — pointing the editor at alternative engines.