Podman: --userns=keep-id and --security-opt label=disable are never applied on the Docker Compose path
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 74/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- docker, docker-compose, typescript
- Domain
- devops
Research direction
Read getPodmanArgs() in src/spec-node/singleContainer.ts and the compose handling in src/spec-node/dockerCompose.ts, then run the two devcontainer up commands from the reproduction. Done means the generated docker-compose.devcontainer.*.yml override applies userns_mode and security_opt to the primary service, matching the single-container Podman behavior.
Written by the indexing model from the issue text.
Description
The problem
getPodmanArgs() — which adds --security-opt label=disable and, for a non-root remoteUser, --userns=keep-id — lives in src/spec-node/singleContainer.ts and is typed to DevContainerFromDockerfileConfig | DevContainerFromImageConfig. src/spec-node/dockerCompose.ts contains no podman handling at all, so a compose-based dev container on rootless podman gets neither flag.
Result: with rootless podman, the host user maps to container root, so a workspace bind mount appears as root:0 inside and the non-root remoteUser cannot write to it.
Reproduction
devcontainer CLI 0.87.0, podman 5.8.2 rootless, Linux. Two configs differing only in single-container vs compose, both "remoteUser": "vscode", same base image.
repro-sc/.devcontainer/devcontainer.json
{ "name": "sc", "image": "mcr.microsoft.com/devcontainers/base:ubuntu", "remoteUser": "vscode" }
repro-co/.devcontainer/devcontainer.json + docker-compose.yml
{ "name": "co", "dockerComposeFile": "docker-compose.yml", "service": "app",
"workspaceFolder": "/workspace", "remoteUser": "vscode" }
services:
app:
image: mcr.microsoft.com/devcontainers/base:ubuntu
command: sleep infinity
volumes: [ "..:/workspace:cached" ]
devcontainer up --workspace-folder repro-sc --docker-path $(which podman) --docker-compose-path $(which docker-compose)
devcontainer up --workspace-folder repro-co --docker-path $(which podman) --docker-compose-path $(which docker-compose)
--docker-path/--docker-compose-path are explicit only to make podman detection unambiguous; lookupCLIVariant correctly reports Podman in both runs.
Result
podman inspect <sc> --format '{{.HostConfig.UsernsMode}} {{.HostConfig.SecurityOpt}}'
private [label=disable]
podman inspect <co> --format '{{.HostConfig.UsernsMode}} {{.HostConfig.SecurityOpt}}'
(empty) []
Both workspaces are dev:1000 on the host:
| workspace owner inside | write as remoteUser |
|
|---|---|---|
| single container | vscode:1000 |
OK |
| compose | root:0 |
Permission denied |
Expected
The compose path should apply the same podman handling as the single-container path — emitting the flags into the generated docker-compose.devcontainer.*.yml override (userns_mode, security_opt) for the primary service.
Related but different
#1004 / #1018 (omit keep-id for root) and #1284 / #1285 (derive the mapping from the remote user's real UID/GID) all concern how getPodmanArgs should behave. This is that the compose path never calls it. Whatever #1285 settles for the mapping should presumably apply to both paths.
- Dominant language
- TypeScript
- Stars
- 3k
- Forks
- 461
- Avg merge
- 18m
- Merged PRs (30d)
- 5
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from devcontainers/cli
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
devcontainers/cli#1203 ·
-
Difficulty 1/5 1-3 hours Newbie friendliness 68/100
devcontainers/cli#1178 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
devcontainers/cli#1308 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 78/100
devcontainers/cli#1307 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
devcontainers/cli#1305 ·
All issues in devcontainers/cli
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
ontola/atomic-server#1625 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
melgarafael/DeskcommCRM#1451 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
bug via-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bot:ai-assisted component:compact-js status:untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
midnightntwrk/midnight-sdk#403 ·