0

I'm not able to make it working :( I have a setup where I connect using SSH to a remote server where I'm running several docker containers in a rootless-docker configuration.

I'm able to see the docker containers in VSCode and also to Attach shell to any of them.

However when trying to Attach Visual Studio Code I get the following error output:

[644094 ms] Start: Run in Host: docker version --format {{.Server.APIVersion}}
[644194 ms] 
[644194 ms] Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

As you can see, it is trying to use unix:///var/run/docker.sock instead of unix:///var/run/user/1001/docker.sock which I configured in my workspace settings.json file:

{
  "docker.environment": {
    "DOCKER_HOST": "unix:///run/user/1001/docker.sock"
  }
}

I have also enable rootless context under the Contexts menu.

Any idea why Attach shell is working while Attach Visual Code is not. I have read many of the solutions here and there, and tested them without success.

Edit:

I have also tried using the following settings.json but it doesn't work.

{
  "docker.environment": {
    "DOCKER_HOST": "ssh://jlanza@myserver.hostname.eu"
  }
}
jlanza
  • 1,208
  • 3
  • 23
  • 43
  • I am facing the same issue, but have found out the work around mentioned in my question here: https://stackoverflow.com/q/71322556/11687201 – ai2ys Mar 06 '23 at 15:13

0 Answers0