Skip to content

Instantly share code, notes, and snippets.

@josecaos
Created August 23, 2019 19:32
Show Gist options
  • Select an option

  • Save josecaos/b1f43d2dcba6c112de96bafe80c6d1f8 to your computer and use it in GitHub Desktop.

Select an option

Save josecaos/b1f43d2dcba6c112de96bafe80c6d1f8 to your computer and use it in GitHub Desktop.
Arragla permisos de docker
How to fix docker ‘Got permission denied while trying to connect to the Docker daemon socket’
Problem:
You are running a command like docker ps but you get this error message:
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.39/containers/json: dial unix /var/run/docker.sock: connect: permission denied
Solution:
As a quick fix, running the command as root using sudo (e.g. sudo docker ps) will solve the issue temporarily.
The issue here is that the user you’re running the command as is not a member of the docker group. In order to add it to the docker group, run
sudo usermod -a -G docker $USER
After running that command, you need to logout and log back in to your computer (or terminate your SSH session and re-connect in case you are logged in using SSH) – else, the group change does not take effect.
// Tomado de: https://techoverflow.net/2018/12/15/how-to-fix-docker-got-permission-denied-while-trying-to-connect-to-the-docker-daemon-socket/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment