Automatically selecting dev.containers.dockerSocketPath
based on remote context
#10761
Labels
containers
Issue in vscode-remote containers
feature-request
Request for new features or functionality
Milestone
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 fordev.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 changedev.containers.dockerSocketPath
. For example, I currently have the following remote contexts:npipe:////./pipe/dockerDesktopLinuxEngine
/var/run/docker.sock
ssh://host3
/var/run/docker.sock
ssh://host1/run/user/1001/podman/podman.sock
/run/user/1001/podman/podman.sock
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 becausepodman context
is a link topodman system connection
(containers/podman#12811), and the latter does not implement a JSON-formattedinspect
command, so it is not supported.In fact, as mentioned in #10005, directly setting
/run/user/$(id -u)/podman/podman.socket
as the value fordev.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!
The text was updated successfully, but these errors were encountered: