/var/run/docker.sock: permission denied
$ docker ps FATA[0000] Get http:///var/run/docker.sock/v1.16/containers/json: dial unix /var/run/docker.sock: permission denied. Are you trying to connect to a TLS-enabled daemon without TLS?First quick look at the
/var/run/docker.sock
file.
$ ls -l /var/run/docker.sock srw-rw---- 1 root docker 0 sty 28 11:53 /var/run/docker.sockThe solution should be now clear - you can solve the issue by adding user you are logged in to the
docker
group.
So, let's do this:
$ sudo gpasswd -a ${USER} dockerThere should be now a change in
/etc/group
file.
$ cat /etc/group | grep ^dockerNext you need start new terminal session to apply the change and check if you are in the
docker
group. Should be listed in the following command execution:
$ groupsIf still cannot see docker in the groups you're in - and you run linux with graphical interface (eg Ubuntu) you may need basically restart machine. Once done restart your docker container (if you were not needed restarting machine in previous step ;)
$ sudo service docker.io restartThat's all, now
docker ps
should be no problem to run.
This solved my problem. Thanks a lot.
OdpowiedzUsuńThank you, for sharing.
OdpowiedzUsuń