Skip to content

Improving Podman users experience: docker-in-docker #10706

Closed

Description

@l0rd

Hi 👋, I am Mario, and I am a Podman maintainer.

Kudos to the team for the Dev Containers extension 🚀. It's a great project, and we look forward to collaborating to improve Podman users' UX.

For this reason, I would like to suggest a solution to run commands that require docker-in-docker, such as “Dev Containers: Try a Dev Container Sample” and “Dev Containers: Clone Repository in Container Volume…” with Podman.

Podman can currently do docker-in-docker, but requires an extra flag (--security-opt label=disable) compared to Docker:

# Fail
podman run -t --rm -v /var/run/docker.sock:/var/run/docker.sock docker:latest docker ps
# Work
podman run --security-opt label=disable -t --rm -v /var/run/docker.sock:/var/run/docker.sock docker:latest docker ps

Docker doesn’t mind because --security-opt label=disable is the default:

# Work
docker run -t --rm -v /var/run/docker.sock:/var/run/docker.sock docker docker:latest ps
# Work
docker run --security-opt label=disable -t --rm -v /var/run/docker.sock:/var/run/docker.sock docker:latest docker ps

To address the docker-in-docker problem for Podman, without affecting Docker, you could specify --security-opt label=disable every time you mount the /var/run/docker.sock in a container. Is it something that you can change?


  • VSCode Version: 1.96.4
  • Local OS Version: macOS 15.3
  • Remote OS Version: Fedora 41
  • Remote Extension/Connection Type: Dev Containers
  • Logs:
[2025-02-14T17:03:59.108Z] Start: Run in container: docker volume ls -q
[2025-02-14T17:03:59.214Z] Stop (106 ms): Run in container: docker volume ls -q
[2025-02-14T17:03:59.215Z] Start: Run: /Users/mloriedo/Git/podman/bin/darwin/podman rm -f c7f217518982d6099a73972e0ba2b8647f739f8577cecace95f8dcf716765839
[2025-02-14T17:03:59.218Z] Command failed: docker volume ls -q
[2025-02-14T17:03:59.218Z] permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.45/volumes": dial unix /var/run/docker.sock: connect: permission denied
[2025-02-14T17:03:59.218Z] Exit code 1
[2025-02-14T17:04:09.150Z] Start: Run: /Users/mloriedo/Git/podman/bin/darwin/podman volume ls -q
[2025-02-14T17:04:09.254Z] Stop (104 ms): Run: /Users/mloriedo/Git/podman/bin/darwin/podman volume ls -q

Steps to Reproduce:

  1. Configure Dev Containers extension to use podman as described in doc
  2. Open the command palette and select Dev Containers: Try a Dev Container Sample and select one of the samples

Does this issue occur when you try this locally?: No
Does this issue occur when you try this locally and all extensions are disabled?: No

Activity

  1. added
    containers
    on Feb 14, 2025
  2. chrmarti commented on Feb 19, 2025

    @chrmarti
    Contributor

    Hi Mario, thanks for investigating, this makes sense!

  3. added
    podman
    on Feb 19, 2025
  4. chrmarti commented on Feb 25, 2025

    @chrmarti
    Contributor

    This is fixed in Dev Containers 0.399.0-pre-release. A PR for the docker-outside-of-docker feature should go in soon.

  5. l0rd commented on Feb 25, 2025

    @l0rd
    Author

    Thank you Christof Marti (@chrmarti) I have successfully tested the Dev Containers 0.399.0-pre-release on both macOS and Windows. The commands that were failing are now working:

    Is the docker-outside-of-docker feature this one?

  6. chrmarti commented on Feb 25, 2025

    @chrmarti
    Contributor

    Mario Loriedo (@l0rd) I was only looking at the one we maintain. PR: devcontainers/features#1278

  7. chrmarti commented on Mar 4, 2025

    @chrmarti
    Contributor

    Got that also merged. Closing this issue, thanks.

  8. l0rd commented on Mar 4, 2025

    @l0rd
    Author

    Christof Marti (@chrmarti), we should update the documentation now that these changes have been released. If you consider it useful, I can submit a PR to address that.

  9. chrmarti commented on Mar 4, 2025

    @chrmarti
    Contributor

    Mario Loriedo (@l0rd) I would appreciate that, thank you!

  10. locked and limited conversation to collaborators on Apr 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

containersdebtpodman

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions