• 欢迎访问少将全栈,学会感恩,乐于付出,珍惜缘份,成就彼此、推荐使用最新版火狐浏览器和Chrome浏览器访问本网站。
  • 吐槽,投稿,删稿,交个朋友,商务沟通v:ai_draw
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏少将全栈吧

Docker实践安装后出现:Cannot connect to the Docker daemon.

点滴 admin 7年前 (2017-09-08) 4117次浏览 已收录 0个评论 扫描二维码

许久没有用腾讯云了,然后今天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;">&nbsp;</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;">
    &nbsp;
</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;">&nbsp;</span> 
            </p>
            <p style="text-indent:2em;">
                <span style="font-size:16px;">&nbsp;</span> 
            </p>
            <p style="text-indent:2em;">
                <br />
            </p>
喜欢 (0)
[🍬谢谢你请我吃糖果🍬🍬~]
分享 (0)
关于作者:
少将,关注Web全栈开发、项目管理,持续不断的学习、努力成为一个更棒的开发,做最好的自己,让世界因你不同。
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址