Warning: failed to get default registry endpoint from daemon

Docker error

Warning: failed to get default registry endpoint from daemon (Cannot connect to the Docker daemon. Is the docker daemon running on this host?) .

operating system: CentOS7
execution command: docker info, docker search, docker pull
execution user: non-root, has sudo permission

guess error and execute user permission, use sudo docker info will also report error, but docker --version normal
execute sudo dockerd after CTRL +c interrupt, stop docker service and then restart, then use sudo docker info normal, No attempt to use root user directly is normal

停服启动命令
$ sudo systemctl stop docker.service
$ sudo systemctl start docker.service

不加sudo依然会报以下错误
被允许否认在试图连接到码头工人在unix守护进程插座:/// var /运行/码头工人。袜子:获取http://%2Fvar%2Frun%2Fdocker.sock/v1.38/info:拨打unix/var/run/docker.html。sock: connect:权限被拒绝

Read More: