Skip to content

Container samples not working using podman #2881

Open

Description

@mjbvz

Refs #2854

repro

  1. Using podman 1.9
  2. Run Containers: Try a sample and select Python

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]

Activity

  1. added
    bug
    containers
    on Apr 29, 2020
  2. chrmarti commented on Apr 30, 2020

    @chrmarti
    Contributor

    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.)

  3. chrmarti commented on Apr 30, 2020

    @chrmarti
    Contributor
  4. Chuxel commented on Apr 30, 2020

    @Chuxel
    Member

    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?

  5. chrmarti commented on May 5, 2020

    @chrmarti
    Contributor

    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.

  6. smekkley commented on May 15, 2020

    @smekkley

    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

  7. chrmarti commented on May 19, 2020

    @chrmarti
    Contributor

    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.

  8. smekkley commented on May 19, 2020

    @smekkley

    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.

  9. smekkley commented on Aug 28, 2020

    @smekkley

    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.

  10. chrmarti commented on Aug 31, 2020

    @chrmarti
    Contributor

    Podman in Podman appears to work now: podman-container-tools/podman#4056 (comment)

  11. dentudave commented on Dec 18, 2020

    @dentudave

    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

    1. podman 2.2.1
    2. fedora 32 and fedora 33 live usb (checked to make sure it wasn't something I had done to my system)
    3. sudo ln -s /usr/bin/podman /usr/bin/docker
    4. Run Containers: Try a sample and select Node
    [2020-12-18T12:30:51.671Z] [PID 5289] [2 ms] Remote-Containers 0.154.1 in VS Code 1.52.0 (940b5f4bb5fa47866a54529ed759d95d09ee80be).
    [2020-12-18T12:30:51.687Z] [PID 5289] [18 ms] Start: Resolving Remote
    [2020-12-18T12:30:51.692Z] [PID 5289] [23 ms] Start: Check Docker is running
    [2020-12-18T12:30:51.692Z] [PID 5289] [23 ms] Start: Run: docker version --format {{.Server.APIVersion}}
    [2020-12-18T12:30:51.833Z] [PID 5289] [164 ms] Server API version: 2.1.0
    [2020-12-18T12:30:51.835Z] [PID 5289] [166 ms] Start: Run: docker volume ls -q
    [2020-12-18T12:30:51.998Z] [PID 5289] [329 ms] Start: Run: docker ps -q -a --filter label=vsch.local.repository=https://github.com/Microsoft/vscode-remote-try-node --filter label=vsch.local.repository.volume=vsc-remote-sample --filter label=vsch.local.repository.folder=vscode-remote-try-node --filter label=vsch.quality=stable
    [2020-12-18T12:30:52.161Z] [PID 5289] [492 ms] Start: Run: docker build -f /home/userName/.vscode/extensions/ms-vscode-remote.remote-containers-0.154.1/scripts/volumeBootstrap.Dockerfile -t vsc-volume-bootstrap /home/userName/.vscode/extensions/ms-vscode-remote.remote-containers-0.154.1/scripts
    [2020-12-18T12:30:52.315Z] [PID 5289] STEP 1: FROM alpine:3.11.2
    [2020-12-18T12:30:52.355Z] [PID 5289] STEP 2: RUN apk add --no-cache 	nodejs 	git 	openssh-client 	docker-cli 	docker-compose 	;
    [2020-12-18T12:30:52.363Z] [PID 5289] --> Using cache d67eafcad1febe41f12f14c01fd80d99bd6ebd09cd23a4535165aeb71e5960a1
    STEP 3: COMMIT vsc-volume-bootstrap
    [2020-12-18T12:30:52.364Z] [PID 5289] 
    [2020-12-18T12:30:52.435Z] [PID 5289] --> d67eafcad1f
    [2020-12-18T12:30:52.461Z] [PID 5289] d67eafcad1febe41f12f14c01fd80d99bd6ebd09cd23a4535165aeb71e5960a1
    [2020-12-18T12:30:52.487Z] [PID 5289] [818 ms] Cloning Github repository: Microsoft/vscode-remote-try-node into /workspaces/vscode-remote-try-node
    
    [2020-12-18T12:30:52.488Z] [PID 5289] [818 ms] Start: Run: docker run -d --mount type=volume,src=vsc-remote-sample,dst=/workspaces -v /var/run/docker.sock:/var/run/docker.sock vsc-volume-bootstrap sleep infinity
    [2020-12-18T12:30:52.678Z] [PID 5289] [1009 ms] Command failed: docker run -d --mount type=volume,src=vsc-remote-sample,dst=/workspaces -v /var/run/docker.sock:/var/run/docker.sock vsc-volume-bootstrap sleep infinity
    

    I've also tried it with the podman-docker package 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.

  12. 5 remaining items

  13. smekkley commented on Jan 4, 2021

    @smekkley

    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.

  14. chrmarti commented on Jan 5, 2021

    @chrmarti
    Contributor

    According to Christof Marti (@chrmarti) , docker socket is mounted in order to build an image alone. With buildah chroot mode, no socket is required. You can just build and export it as tgz and load it from the host container engine.

    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?

    I'd say docker-in-docker should be fixed first. Giving the host root access to some vscode sample container by default is really bad. Then it'll work automatically with podman without special patch dedicated for podman.

    To clarify: Docker's socket is mounted into a temporary container controlled by the extension, this container is not the sample container.

  15. PavelSosin-320 commented on Jan 5, 2021

    @PavelSosin-320

    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.

  16. smekkley commented on Jan 5, 2021

    @smekkley

    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) .

  17. PavelSosin-320 commented on Jan 7, 2021

    @PavelSosin-320

    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.

  18. leighmcculloch commented on Sep 7, 2021

    @leighmcculloch

    I seem to be able to fix the above error using systemctl enable --now podman.socket

    Matthew Froggatt (@matt-froggatt) Could you expand on this work around?

  19. Sangeppato commented on Oct 3, 2022

    @Sangeppato

    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 --privileged or --security-opt=label=disable in 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.json file, 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).

  20. chrmarti commented on Oct 6, 2022

    @chrmarti
    Contributor

    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!

  21. DarkBitz commented on Oct 26, 2022

    @DarkBitz

    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 directory
    goes away after following the instruction of the podman CLI output

    The system helper service is not installed; the default Docker API socket
    address can't be used by podman. If you would like to install it run the
    following commands:
    
            sudo /opt/homebrew/Cellar/podman/4.3.0/bin/podman-mac-helper install
            podman machine stop; podman machine start
    

    The leftover bug is

    [2022-10-26T19:22:11.806Z] Stop (2110 ms): Installing VS Code Server
    [2022-10-26T19:22:11.806Z] Start: Run in container: mkdir -p '/root/.vscode-server/bin' && ln -snf '/vscode/vscode-server/bin/alpine-arm64/d045a5eda657f4d7b676dedbfa7aab8207f8a075' '/root/.vscode-server/bin/d045a5eda657f4d7b676dedbfa7aab8207f8a075'
    [2022-10-26T19:22:11.808Z] 
    [2022-10-26T19:22:11.808Z] mkdir: cannot create directory ‘/root’: Permission denied
    [2022-10-26T19:22:11.808Z] Exit code 1
    

    which can be solved with

    ENV HOME /home/vscode
    

    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 :(

  22. chrmarti commented on Oct 28, 2022

    @chrmarti
    Contributor

    --userns=keep-id might help, see #6759.

  23. added
    podman
    on Dec 12, 2023
  24. bam80 commented on Jan 25, 2024

    @bam80

    Any progress on this?

  25. tnk4on commented on Feb 7, 2024

    @tnk4on

    I opened new issue. see podman-container-tools/podman#21548

  26. tnk4on commented on Jan 1, 2026

    @tnk4on

    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

    Component Version
    OS macOS 26.1 (Tahoe) - darwin 25.1.0 arm64
    Podman 5.7.1
    Podman Machine libkrun
    @devcontainers/cli 0.80.3
    Dev Containers Extension 0.435.0

    Configuration

    Only one setting is required:

    {
      "dev.containers.dockerPath": "podman"
    }

    Sample Tests (using devcontainer templates apply)

    Sample Template Result Notes
    Python ghcr.io/devcontainers/templates/python ✅ PASSED Python 3.12.12
    Node.js ghcr.io/devcontainers/templates/javascript-node ✅ PASSED Node v22.16.0
    Go ghcr.io/devcontainers/templates/go ✅ PASSED Go 1.22.12

    All 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

    Original Issue Status
    "Container samples not working using podman" ✅ Fixed - Samples now work
    Mount option syntax error ✅ Fixed
    docker.sock mount / SELinux issues ✅ Fixed (auto --security-opt label=disable)
    File permission/UID issues ✅ Fixed (auto --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!

  27. bam80 commented on Nov 1, 2026

    @bam80

    Shion Tanaka (@tnk4on) could you please add Compose to your tests? There are still issues there:
    devcontainers/cli#1300

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugcontainerspodman

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions