Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically selecting dev.containers.dockerSocketPath based on remote context #10761

Open
Aurorabili opened this issue Mar 7, 2025 · 1 comment
Assignees
Labels
containers Issue in vscode-remote containers feature-request Request for new features or functionality

Comments

@Aurorabili
Copy link

Description

Docker-in-Docker requires dev.containers.dockerSocketPath to pass the socket to the container. However, different remote contexts have different socket paths. Is there a way to automatically select the appropriate value for dev.containers.dockerSocketPath based on the current context?

Motivation

I use development containers to work by connecting to a remote socket via a remote context. Recently, I have been gradually switching to using Podman rootless instead of Docker. Podman rootless has a different default socket path, usually $XDG_RUNTIME_DIR/podman/podman.sock. Every time I switch between remote contexts with different socket paths, I have to manually change dev.containers.dockerSocketPath. For example, I currently have the following remote contexts:

NAME ENDPOINT DOCKER SOCKET PATH
desktop-linux (WSL2) npipe:////./pipe/dockerDesktopLinuxEngine /var/run/docker.sock
docker remote ssh://host3 /var/run/docker.sock
podman-rootless ssh://host1/run/user/1001/podman/podman.sock /run/user/1001/podman/podman.sock
podman-rootful ssh://host2/run/podman/podman.sock /var/run/docker.sock -> /run/podman/podman.sock

Discussion

In #10005, there was a discussion about whether the socket path could be retrieved from podman context inspect. Unfortunately, podman context inspect still does not return any content. This might be because podman context is a link to podman system connection (containers/podman#12811), and the latter does not implement a JSON-formatted inspect command, so it is not supported.

In fact, as mentioned in #10005, directly setting /run/user/$(id -u)/podman/podman.socket as the value for dev.containers.dockerSocketPath results in a "socket not found" error because it is passed as a string to Podman instead of being resolved to $(id -u).

Related

#10706


This is a great project, and I look forward to better integration with Podman. Thanks to everyone involved!

@vs-code-engineering vs-code-engineering bot added the containers Issue in vscode-remote containers label Mar 7, 2025
@chrmarti chrmarti added the feature-request Request for new features or functionality label Mar 10, 2025
@vs-code-engineering vs-code-engineering bot added this to the Backlog Candidates milestone Mar 10, 2025
Copy link

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 10 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
containers Issue in vscode-remote containers feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

2 participants