安装 docker 执行错误如下:
$ docker ps
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
解决方法:
docker.sock 文件的权限问题,可以重置其权限:
sudo chmod 666 /var/run/docker.sock
之后就正常了
lighthouse@VM-ubuntu:~$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES