even after adding sudo groupadd docker
and sudo usermod -aG docker $USER
, i cannot use docker commands without sudo
`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/containers/json": dial unix /var/run/docker.sock: connect: permission denied.
So I had to use "sudo". How can I get ignored sudo in docker commands
4
Answers
Create a group called
docker
and add yourself to it using the commandsThen you can run docker commands without using sudo.
Giving more access to this file solves the problem, but it is not recommended it gives every local process and user unrestricted root access over the host!
then you don’t need to use sudo but it’s not recommended.
Try restarting docker.
After I installed Docker Desktop my Docker context was changed. Docker CLI commands are being forwarded to Docker Desktop instead of Docker Engine. If you have the same problem you can try