许久没有用腾讯云了,然后今天ss上去的时候,想部署一个demo测试测试。
结果呢,起不来。
<
p style=”text-indent:2em;”>
[root@VM_104_126_centos ~]# docker ps Cannot connect to the Docker daemon. Is the docker daemon running on this host? [root@VM_104_126_centos ~]# docker search test Cannot connect to the Docker daemon. Is the docker daemon running on this host? [root@VM_104_126_centos ~]# docker run hello-world /usr/bin/docker-current: Cannot connect to the Docker daemon. Is the docker daemon running on this host?. See ’/usr/bin/docker-current run --help’. [root@VM_104_126_centos ~]# service docker start Redirecting to /bin/systemctl start docker.service
<p>
<br />
</p>
<p style="text-indent:2em;">
<span style="font-size:16px;"> </span>
</p>
<p style="text-indent:2em;">
<span style="font-family:Microsoft YaHei;font-size:16px;">运行docker命令直接显示Cannot connect to the Docker daemon. Is the docker daemon running on this host?</span>
</p>
<p style="text-indent:2em;">
<span style="font-family:Microsoft YaHei;font-size:16px;">最后发现是docker服务没有起来。</span>
</p>
<p align="center">
<a id="ematt:3851" href="https://www.whatled.com/content/uploadfile/201709/b7c71504849819.png" target="_blank"><img title="Docker实践安装后出现:Cannot connect to the Docker daemon." border="0" alt="Docker实践安装后出现:Cannot connect to the Docker daemon." src="https://www.whatled.com/content/uploadfile/201709/b7c71504849819.png" width="808" height="679" /></a>
</p>
<p style="text-indent:2em;">
</p>
<p style="text-indent:2em;">
<span style="font-family:Microsoft YaHei;font-size:16px;">运行</span>
</p>
<p style="text-indent:2em;">
service docker start
<p>
<br />
</p>
<p style="text-indent:2em;">
<span style="font-family:Microsoft YaHei;font-size:16px;">问题解决,可以将docker设置为开机启动如下:</span>
</p>
<p style="text-indent:2em;">
su root # 先切换到root用户, 再执行以下命令 systemctl enable docker # 开机自动启动docker systemctl start docker # 启动docker systemctl restart docker # 重启dokcer
<
p>
[root@VM_104_126_centos ~]# systemctl enable docker Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service. [root@VM_104_126_centos ~]# systemctl start docker [root@VM_104_126_centos ~]# systemctl restart docker
<p style="text-indent:2em;">
<span style="font-size:16px;"> </span>
</p>
<p style="text-indent:2em;">
<span style="font-size:16px;"> </span>
</p>
<p style="text-indent:2em;">
<br />
</p>