其他分享
首页 > 其他分享> > docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon run

docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon run

作者:互联网

问题·如下

[root@echohye ~]# docker run hello-world
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.

看问号就知道什么问题了

docker没启动呀

service docker start

一些常用的docker命令:

sudo可省
Docker启动命令1: sudo systemctl start docker

Docker启动命令2: sudo service docker start

Docker重启命令1: sudo systemctl restart docker

Docker重启命令2: sudo service docker restart

docker关闭命令1: sudo systemctl stop docker

docker关闭命令2: sudo service docker stop

守护进程重启: sudo systemctl daemon-reload

设置Docker开机自启动方式1: systemctl enable docker.service

设置Docker开机自启动方式2: chkconfig docker on

关闭Docker开机启动: systemctl disable docker.service

查看是否设置开机启动列表: systemctl list-unit-files | grep enable

标签:daemon,run,service,sudo,systemctl,Docker,docker
来源: https://www.cnblogs.com/echohye/p/16581506.html