An error is reported when using the docker command, prompting: Cannot connect to the Docker daemon at unix:///var/run/docker.sock.

报错现象

[root@node02 ~]# docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

解决思路

  • Check the service status and find that the service is running normally
    Insert picture description here
  • The cause of the problem: It
    may be that the docker did not exit normally last time, so the docker did not start normally, and the docker process could not be found under the corresponding /var/run/ path.

解决方法

  • Execute the following commands in the terminal
[root@node02 ~]# systemctl stop docker.socket
[root@node02 ~]# sudo systemctl restart docker
[root@node02 ~]# docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES

Insert picture description here
Successfully resolved

Guess you like

Origin blog.csdn.net/weixin_42449832/article/details/114994451