Reputation: 1449
Wondering if anyone has been able to overcome this error message in Visual Studio Code while using the Dev Containers extension and Rootless Docker:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Exact output from Visual Studio Code:
Environment:
What I have tried:
Set the DOCKER_HOST
environment variable in /etc/profile.d/my_env_vars.sh
(I made sure to re-login after setting the variable): export DOCKER_HOST=unix:///run/user/1000/docker.sock
Create a symlink to /run/user/1000/docker.sock
: ln -s /run/user/1000/docker.sock /var/run/docker.sock
Install the VsCode Docker extension then set the DOCKER_HOST
variable to: unix:///run/user/1000/docker.sock
Verify Docker is operational: docker run hello-world
Hello from Docker! This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
Verify the Active Context: docker context ls
Thanks for your help.
Upvotes: 4
Views: 1052
Reputation: 11
Not sure if it will fix your problem, but I had a similar issue. What resolved it was the following (not sure which step actually fixed the issue):
sudo apt update && sudo apt upgrade
Hope this helps.
Upvotes: 1