profile
viewpoint

Ask questionsConnect to remote docker daemon when using "Remote - SSH" extension

The Remote - SSH extension

This week, the Remote Development pack was released to Insiders. This allows you to open up a VSCode window as if it were running on the remote host. I have been using the Remote - SSH extension to connect to a server and it works beautifully.

Expected vscode-docker behaviour

When I install the vscode-docker extension, it should be installed to the remote VSCode installation.
When opening a remote (SSH) vscode session, vscode-docker should list images/containers from the docker daemon on the remote host.

Actual vscode-docker behaviour

The extension is installed locally and lists my local containers/images.

Summary

It would be fantastic if these two extensions could work together so that I can view my remote docker container/images while I'm developing remotely over SSH and my local ones when working locally.

I don't think this effects the Remote - WSL and Remote - Containers extensions as developers tend to use the local Docker daemon in these environment anyway (either via opening TCP port 2375 or by using some form of DinD).

Potentially related to #216 & #646.

microsoft/vscode-docker

Answer questions aruiz14

My expectations were also that it would use the docker socket in the remote, but it didn't work like that.

I managed to make it work with this workaround:

  • In your ~/.ssh/config, you can add to the section of the host you are connecting to the line (the actual port used is irrelevant, you can use a different one as long as it's not in use):
LocalForward 22375 /var/run/docker.sock
  • Then, while connected to the remote host, go to Settings, select the tab for the remote host and change the Docker Host config to localhost:22375.

You may need to reconnect to the host or restart VSCode for this to take effect.

useful!

Related questions

Error Message: connect EACCES /var/run/docker.sock hot 3
Error Message: connect EACCES /var/run/docker.sock hot 1
Debug not running hot 1
Error:connect ENOENT //.pipe/docker_engine hot 1
Error:connect ENOENT //.pipe/docker_engine hot 1
In order to use an SSH DOCKER_HOST on OS X and Linux, you must configure an ssh-agent. - vscode-docker hot 1
In order to use an SSH DOCKER_HOST on OS X and Linux, you must configure an ssh-agent. hot 1
Improve error message when docker has not been found- ENOENT //./pipe/docker_engine hot 1
VSCode: "No matching resources found." when using with Azure Container Registry extension hot 1
Starting container process caused "process_linux.go:297: applying cgroup configuration for process caused \"open hot 1
Error:connect ENOENT //.pipe/docker_engine hot 1
browse to containers step gives 401 error hot 1
Error Message: connect EACCES /var/run/docker.sock hot 1
Docker Machine crashes when managing Docker containers with vscode-docker plugin hot 1
source:https://uonfu.com/
Github User Rank List