Repository navigation
Open
Labels
bugIssue identified by VS Code Team member as probable bugcontainersIssue in vscode-remote containerspodmanDev Container using Podman
Milestone
Description
Refs #2854
repro
- Using podman 1.9
- Run
Containers: Try a sampleand selectPython
Bug
The container fails to start.
Logs:
[0 ms] Start: Resolving remote
[2 ms] Start: Check Docker is running
[2 ms] Start: Run: docker info
[366 ms] Start: Run: docker volume create --label vsch.local.repository=https://github.com/Microsoft/vscode-remote-try-python --label vsch.local.repository.unique=false vsc-remote-sample
[473 ms] Start: Run: docker ps -q -a --filter label=vsch.local.repository=https://github.com/Microsoft/vscode-remote-try-python --filter label=vsch.local.repository.volume=vsc-remote-sample --filter label=vsch.local.repository.folder=vscode-remote-try-python --filter label=vsch.quality=insider
[590 ms] Start: Run: docker build -f /home/parallels/.vscode-insiders/extensions/ms-vscode-remote.remote-containers-0.113.0/scripts/volumeBootstrap.Dockerfile -t vsc-volume-bootstrap /home/parallels/.vscode-insiders/extensions/ms-vscode-remote.remote-containers-0.113.0/scripts
STEP 1: FROM alpine:3.11.2
STEP 2: RUN apk add --no-cache nodejs git openssh-client docker-cli ;
--> Using cache 0faec7dc36e550fd8340d295a87eac456ae140b80a203267ccd6b6f0e0a2c286
STEP 3: COMMIT vsc-volume-bootstrap
--> 0faec7dc36e
0faec7dc36e550fd8340d295a87eac456ae140b80a203267ccd6b6f0e0a2c286
[731 ms] Cloning Github repository: Microsoft/vscode-remote-try-python into /workspaces/vscode-remote-try-python
[731 ms] Start: Run: docker run -d --mount src=vsc-remote-sample,dst=/workspaces,type=volume,volume-driver=local -v /var/run/docker.sock:/var/run/docker.sock vsc-volume-bootstrap sleep infinity```
And the specific error:
$ docker run -d --mount src=vsc-remote-sample,dst=/workspaces,type=volume,volume-driver=local -v /var/run/docker.sock:/var/run/docker.sock vsc-volume-bootstrap sleep infinity
Error: "src=vsc-remote-sample,dst=/workspaces,type=volume,volume-driver=local": incorrect mount format: should be --mount type=<bind|tmpfs|volume>,[src=<host-dir|volume-name>,]target=<ctr-dir>[,options]
Reacted by Matthew Froggatt, Jeffrey Serio, Leigh, Gabriel Ebner, Kris Knigga, Uladzimir Abramchuk, Florian Kaiser, DarkBitz, Martin Adler, Jesse Farebrother and 3 more
Metadata
Metadata
Assignees
Labels
bugIssue identified by VS Code Team member as probable bugcontainersIssue in vscode-remote containerspodmanDev Container using Podman
Activity
chrmarti commentedon Apr 30, 2020
With Docker we mount the Docker socket into a container to build the image from a volume. We need to investigate if something similar can be done with Podman. (Seeing podman-container-tools/podman#4056 and podman-container-tools/podman#4131 discussions.)
chrmarti commentedon Apr 30, 2020
/cc Erich Gamma (@egamma)
Chuxel commentedon Apr 30, 2020
Erich Gamma (@egamma) Christof Marti (@chrmarti) Related question: Given the challenges with the repo approach that people are experiencing yet, should we have the getting started documentation reference the local clone based approach for try repos still while we iron out the kinks?
chrmarti commentedon May 5, 2020
Chuck Lantz (@Chuxel) Makes sense, although I wouldn't consider this Podman issue a blocker. It would be good to have a fix for the Docker case where the user gets stuck with a bad config (#2428). I think Erich Gamma (@egamma) mentioned looking into fixing that, so a solution might not be too far out.
smekkley commentedon May 15, 2020
I created this issue in libpod. It's technically possible to control podman from container through ssh varlink but there is a new api server. I'd say we can wait until podman api is complete, then vscode sample container can have podman inside access it through unix socket or tcp socket.
podman-container-tools/podman#6219
chrmarti commentedon May 19, 2020
Do we need to go through an API server? My understanding of Podman is that it works without a server, so the API server shouldn't add anything beyond giving access to the local libpod. Maybe we can access that from the container directly if we give the container the required privileges.
The reason we need this is that we want to build a Docker image from the sources we clone into a Docker volume. The container for doing this is temporary.
smekkley commentedon May 19, 2020
API is just a way to get out of podman container to do what the current docker solution in vscode is basically doing, it's not actually a container in container. This is already supported by varlink or api(in the future) in podman.
If building container in container is the only requirement, that's also supported but you have to use buildah with chroot isolation mode with vfs inside podman.
This has been supported for a while. It can be done inside rootless podman or docker as long as buildah is present inside the container.
smekkley commentedon Aug 28, 2020
I wonder if there has been any decision made on this topic.
Mounting docker socket is really bad imo. I think that should be solved first and then support podman properly.
chrmarti commentedon Aug 31, 2020
Podman in Podman appears to work now: podman-container-tools/podman#4056 (comment)
dentudave commentedon Dec 18, 2020
I'm unable to get the sample containers to run using podman, it's failing at the same step, but producing a slightly different error.
repro
sudo ln -s /usr/bin/podman /usr/bin/dockerContainers: Try a sampleand selectNodeI've also tried it with the
podman-dockerpackage as denoted in #116 it gave the same result.I'm willing to make a new bug ticket since my problem seems slightly different and this issue is rather broad.
5 remaining items
smekkley commentedon Jan 4, 2021
You can export it as tgz or tar so that you can load from any container engine.
I wanted to suggest this solution because I felt like we are neglecting the issue with the current implementation with docker by fixing solution only for podman.
chrmarti commentedon Jan 5, 2021
Exporting and importing a tgz will add to the startup time. Can we instead mount Podman's local image folder and just build the image for that directly?
To clarify: Docker's socket is mounted into a temporary container controlled by the extension, this container is not the sample container.
PavelSosin-320 commentedon Jan 5, 2021
Using sockets for Buildah and Podman is meaningless. Both are CLI development tools. Podman socket is used only to use Podman remotely. The real "remote Podman" is Kubernetes. Kubernetes and Docker have divorced. Buildah can run on the "bare" Linux OS or Linux VM. The alternative is Running Buildah in container.
The attempts to mimic Docker using Podman in the development environment adds complexity but no new feature.
smekkley commentedon Jan 5, 2021
You might be able to bind mount the whole docker/podman image directory, but then it's no different from mounting docker socket for no good reason(the current solution). The current solution might be good enough for environment where docker is running on different filesystem like docker-for-mac, but not for native linux.
I suggest reading the link that PavelSosin-320 provided. Christof Marti (@chrmarti) .
PavelSosin-320 commentedon Jan 7, 2021
Matthew Froggatt (@matt-froggatt) Do you suggest to run Podman as the Docker engine using systemctl enable --now podman.socket ? It will revert all Podman benefits back to the Docker limitations: The Podman socket will restrict access to the Podman to only Rootfull users (root, wheel ) or users that belong to the Docker group. The Podman listener service has to be started during "boot" or externally. Instead of plain Linux security users will have to deal with Proxies, Network security, Ports forwarding over the network. Special efforts will be required to handle unique Docker repository protocol instead of free choice of repository transport.
Everywhere when Linux runs or Linux VM is available Podman, Buildah, Skopeo can natively. without "proxy" software like Dockerod.
I believe that even standalone Buildah can do everything needed for dev-container.
Build the image by Buildah
Create Container by Buildah.
Run the Container by Buildah
If using the Container locally or locally running VM is enough for you.
leighmcculloch commentedon Sep 7, 2021
Matthew Froggatt (@matt-froggatt) Could you expand on this work around?
Sangeppato commentedon Oct 3, 2022
Christof Marti (@chrmarti) sorry to ping you on this, but according to this discussion it looks like the temporary container should be launched with either
--privilegedor--security-opt=label=disablein order to access the socket. Is it possible to pass a runtime flag to the temporary container in any way?I've tried adding those args to the "runArgs" property in the
devcontainer.jsonfile, but my understanding is that this would only act on the final container being built and not on the temporary one used to build it (which is where the issue actually lies).chrmarti commentedon Oct 6, 2022
There is no way to control this currently. We should probably detect that we are using Podman and then add one of these flags. Thanks!
DarkBitz commentedon Oct 26, 2022
In my case, I want to use the Alpine image provided by vscode the error with
[2022-10-26T19:10:38.764Z] Error: statfs /Users/darkbitz/git/devcontainertest: no such file or directorygoes away after following the instruction of the podman CLI output
The leftover bug is
which can be solved with
as last statement in the Dockefile
see #174 (comment)
After this the container could started but the modifications in files could not be saved because of permission denied errors :(
chrmarti commentedon Oct 28, 2022
--userns=keep-idmight help, see #6759.bam80 commentedon Jan 25, 2024
Any progress on this?
tnk4on commentedon Feb 7, 2024
I opened new issue. see podman-container-tools/podman#21548
tnk4on commentedon Jan 1, 2026
Status Update: Container Samples Now Work with Podman (January 2026)
I tested the original issue and can confirm that container samples now work correctly with Podman.
Test Environment
Configuration
Only one setting is required:
{ "dev.containers.dockerPath": "podman" }Sample Tests (using
devcontainer templates apply)ghcr.io/devcontainers/templates/pythonghcr.io/devcontainers/templates/javascript-nodeghcr.io/devcontainers/templates/goAll samples started successfully, and the development environment was fully functional.
Root Cause: Fixed in devcontainers/cli v0.76.0
The issues reported in this thread have been addressed by PR #985 (merged 2025-04-07):
This PR added automatic detection of Podman and applies the necessary flags:
--security-opt label=disable(fixes SELinux/socket mount issues)--userns=keep-id(fixes UID/GID permission issues)Available from: Dev Containers extension 0.412.0+ (confirmed by Christof Marti (@chrmarti) in #10798)
Summary
--security-opt label=disable)--userns=keep-id)Automated Testing Repository
I've created a public repository with comprehensive automated compatibility tests:
The repository includes test results, version tracking, and demonstrates that all reported issues are resolved. You can view the latest test results and status badge in the repository README.
Conclusion
The original issue - container samples not working with Podman - is now resolved. This issue can be closed as the reported functionality works correctly.
Thank you to Christof Marti (@chrmarti) and the VS Code team for the improvements!
bam80 commentedon Nov 1, 2026
Shion Tanaka (@tnk4on) could you please add Compose to your tests? There are still issues there:
devcontainers/cli#1300