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

2022/8/12 23:27:02

本文主要是介绍docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon run,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

问题·如下

[[email protected] ~]# 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



这篇关于docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon run的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程