docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
问题·如下
[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