Linux下,Docker出现Cannot connect to the Docker daemon. 解决办法

在执行docker命令时,譬如docker images时,有时候会出现如下错误信息:Cannot connect to the Docker daemon. Is the docker daemon running on this host。

出现这种情况,有两种原因造成的,一种是服务真的没有起来,另一种是所用的用户没有权限。
不管是哪种情况,执行docker命令时,前面最好追加sudo,以防止没有权限,造成不必要的麻烦。

1、服务没有起来

# 查看服务的Active是否为active (running)状态
sudo service docker status 
# 启动服务
sudo service docker start 

2、所用的用户没有权限

#执行所有的命令前面加上sudo
sudo docker images
sudo docker ps
sudo docker ps -a
sudo docker start xxxx

使用以上两种方法,基本能够解决Cannot connect to the Docker daemon. Is the docker daemon running on this host的问题。

展开阅读全文

页面更新:2024-05-04

标签:不必要   命令   麻烦   状态   原因   情况   方法   用户

1 2 3 4 5

上滑加载更多 ↓
推荐阅读:
友情链接:
更多:

本站资料均由网友自行发布提供,仅用于学习交流。如有版权问题,请与我联系,QQ:4156828  

© CopyRight 2008-2024 All Rights Reserved. Powered By bs178.com 闽ICP备11008920号-3
闽公网安备35020302034844号

Top