Tag Archives: docker daemon

How to Fix ERROR: Couldn’t connect to Docker daemon at http+docker://localhost – is it running?

centos8 using docker composer ERROR: fix ERROR: Couldn’t connect to docker daemon at HTTP +docker://localhost – is it running?

you can see the version number using docker-compose version, proving that the service is enabled. The reason is because it is not added to the Docker group.

execute command: sudo gpasswd-a ${USER} docker note: do not change the command, directly execute

after the execution of the user needs to switch: su root; su hyn

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:权限被拒绝