Open kantesilvestrs opened 2 years ago
Is there any update on this? I have the same issue. On restart my dev environment user requires sudo with docker commands
I also have this issue. When trying to perform docker commands I get permission denied. I have tried adding the user to the docker group, which seems to exist, but this asks for a password, which I dont have
I am also facing the same issue. After some troubleshooting I noticed two very suspicious things:
When I am checking if vscode
user is part of docker
group though group
command, it looks like it is not.
However, I also looked inside /etc/group
file and vscode
user is included there:
...
docker:x:1001:vscode
...
The owner user and group of docker socket are both set to root
. I changed group to docker
, however (because of 1. most probably) it did not solve the issue.
It looks like the gid
of docker.sock
is now set to 800 whenever you start up your VM. If they don't match, then you're going to have problems. We now have this line in our Dockerfile to build the base image:
RUN groupadd docker -g 800
This has solved the docker permissions issue for us.
Describe the bug Dev environment throws
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/version": dial unix /var/run/docker.sock: connect: permission denied
message when trying to interact with docker, e.g.docker stats
after Docker for Desktop has been restarted.To Reproduce Steps to reproduce the behavior:
docker stats
from VS Code terminal to see current running containersdocker stats
from VS Code terminalGot permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/version": dial unix /var/run/docker.sock: connect: permission denied
Expected behavior Running docker commands after Docker for Desktop restart should yield same results when the dev environment is just created and launched.
Screenshots![image](https://user-images.githubusercontent.com/52054299/163564654-27d989a1-92aa-4349-bb4e-5f66d67f5bca.png)
Desktop (please complete the following information):
Version of Docker Desktop:
You can find the version by clicking on the
About Docker Desktop
menuAdditional context I noticed this issue while trying to run a docker instance from the dev environment