Cannot connect to the Docker daemon. Is the docker daemon running on this host?

1.docker这种报错一般情况都是docker未启动对于这种情况只用重启docker就行了:
service docker restart  

2.还有一种情况则是docker配置文件出错按照提示查看报错,并找到相应位置进行更改:
systemctl status docker.service   或    journalctl -xn

3.对于初学者且很难找到报错位置并改正的同学,推荐一个快速的方法---重装大法
 cd /var/lib/docker
 rm –rf *
 service docker restart

4.如果在删除docker文件时报错删除不了,可以选择删除docker或者暂停docker 
yum remove docker


5.使用Ubuntu运行命令systemctl status docker.service遇到下面问题:
SyStem has not been booted with systemd as init system (PID 1). Can't operate.

因为Ubuntu没用systemctl命令
使用service docker restart就行了

原文地址:https://www.cnblogs.com/superelement/p/14780554.html