Using podman-compose in a DevContainer
You want a Compose-style multi-service devcontainer but you're on Podman, not Docker. This page wires the devcontainer to podman-compose (or Podman's Docker-compatible Compose provider), so your app and its backing services run rootless with the same networking and health-gating you'd get on Docker.
Prerequisites
You need rootless Podman and podman-compose (or the compose provider) installed.
- Rootless Podman working.
podman-composeinstalled, or Podman's Compose provider enabled.- A Compose file and a devcontainer that names its service.
Step-by-Step Implementation
- Point the tooling at podman-compose.
{
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspace",
"remoteUser": "vscode"
}
- Set the editor's compose path to podman-compose.
"dev.containers.dockerComposePath": "podman-compose"
- Share a network so services resolve by name.
services:
app: { networks: [devnet] }
db: { image: postgres:16-alpine, networks: [devnet] }
networks: { devnet: {} }
- Verify the app reaches the service by name.
devcontainer exec --workspace-folder . -- getent hosts db
Common Pitfalls
Podman Compose issues are a wrong provider path or missing shared network.
| Symptom | Root Cause | Remediation |
|---|---|---|
| Compose commands fail | Docker compose path assumed | Set dockerComposePath to podman-compose |
| Services can't resolve names | Not on a shared network | Put services on one bridge network |
| Ports not reachable | Rootless low-port limit | Use ports above 1024 |
| App starts before DB | No health gate | Add healthcheck + depends_on |
Conclusion
A multi-service devcontainer runs fine on Podman: point the tooling at podman-compose, put services on a shared bridge so names resolve, and gate startup with health checks. The Compose model is identical — only the provider underneath changes.
FAQ
Can I use a docker-compose.yml unchanged with Podman?
Mostly yes. Point the tooling at podman-compose (or Podman's Docker-compatible Compose provider) and the same Compose file brings the stack up rootless. Watch for rootless port and ownership differences, but the service and network definitions carry over.
Why can't my services find each other? They need to share a user-defined bridge network for name resolution, exactly as on Docker. Put every service that must communicate on one network and address peers by service name.
Do health checks work the same?
Yes — declare healthcheck on services and gate the workspace with depends_on: condition: service_healthy. Podman honours the same Compose health semantics, so startup ordering behaves as it does on Docker.
Related
- Up to Podman & Rootless Container Engines — the overview of rootless engines.
- Mapping UIDs for Rootless Podman DevContainers — ownership under rootless.
- Docker Compose Integration for Multi-Service Apps — the Compose model itself.