Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker 错误

简介: 在使用WSL(Ubuntu 18.04.6)时,初学者遇到运行Docker时的错误:“Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?”。解决问题的过程包括:首先尝试通过`sudo apt-get install daemon`安装daemon,然后使用`sudo service docker start`启动Docker。通过`sudo service docker status`确认Docker已启动,并成功运行`docker

系统版本:WSL Ubuntu18.04.6

最近搞GPU算力,自学很多云原生知识,还是自己太菜了,我真的是醉了啊,初学docker,执行docker ps,发现这个提示:

docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.

image.gif

懵逼了,查了很多资料发现Ubuntu系统的版本不同,启动方式也不同!这里适用 service 启动

下面正式说一下我的处理历程:

1. 查资料发现说WSL中没有daemon

我就开始安装daemon,命令如下:

sudo apt-get install daemon

image.gif

image.png

2.启动docker

先说一下,我得版本是WSL Ubuntu18.04.6,然后这个版本启动docker命令为:

sudo service docker start

image.gif

然后查看docker状态 :

sudo service docker status

image.gif

image.png image.gif 编辑

Ok,这就启动了!

pull一个镜像试一下

sudo docker pull hello-world
sudo docker run hello-world

image.gif

image.png image.gif 编辑

试试其他的命令:

docker ps

docker images

image.png image.gif 编辑

我目前还是很菜。。。如果上述解决不了,我一般重装了,也很快。。

常用一招!  : Linux系统中安装Docker,可以根据Docker官方网站上的步骤操作。


后续应该还会遇到其它问题,到时候再来更新吧,每天进步一点点,博士生活快乐一点点、、、哈哈哈哈咯

相关文章
|
17天前
|
应用服务中间件 nginx Docker
Docker中报错 Error response from daemon: Conflict. The container name “/nginx01“ is already in use
在尝试运行 `docker run -d --name nginx01 -p 3344:80 nginx` 时遇到错误。问题源于已有名为 nginx01 的容器未正确终止,造成命名冲突。解决方法:首先使用 `docker ps -a` 查看所有容器,然后删除现有 nginx01 容器,执行 `docker rm <container_id>`(替换 `<container_id>` 为实际容器ID),最后再运行 `docker run` 命令即可。
|
17天前
|
存储 应用服务中间件 Docker
Docker容器无法启动Cannot find /usr/local/tomcat/bin/setclasspath.sh
根据具体情况,你可以尝试以上方法中的一个或多个,以解决 "Cannot find /usr/local/tomcat/bin/setclasspath.sh" 的问题。确保你的Docker容器中包含了完整且正确配置的Tomcat,并且相关文件和目录的权限设置正确。
40 0
|
17天前
|
Kubernetes Docker 容器
K8s运行Docker容器出现cannot change locale (en_US.UTF-8)
K8s运行Docker容器出现cannot change locale (en_US.UTF-8)
13 0
|
17天前
|
Linux 开发工具 git
【开发专题_03】unable to access ‘https://github.com/deviantony/docker-elk.git/‘: Failed connect to github
【开发专题_03】unable to access ‘https://github.com/deviantony/docker-elk.git/‘: Failed connect to github
53 2
|
17天前
|
Docker 容器
百度搜索:蓝易云【docker启动报错:Cannot connect to the Docker daemon】
通过以上方法,你应该能够解决“Cannot connect to the Docker daemon”错误,并成功启动Docker。如果问题仍然存在,可能需要检查其他系统配置或查看Docker日志以找出具体原因。
49 2
|
11天前
|
Prometheus 监控 Cloud Native
构建高效稳定的Docker容器监控体系
【5月更文挑战第20天】 在微服务架构日益普及的今天,Docker作为其重要的实现技术之一,承载着大量应用的运行。然而,随之而来的是对于容器健康状态、资源使用情况以及性能指标的监控需求急剧增加。本文旨在探讨构建一个高效且稳定的Docker容器监控体系,不仅涵盖了监控工具的选择与配置,还详细阐述了监控数据的分析与处理流程。通过精心设计的监控策略和实时响应机制,我们能够确保系统的稳定性,并及时发现及处理潜在的问题。
|
19小时前
|
Docker 容器
docker: 如何不新建容器 修改运行容器的端口
docker: 如何不新建容器 修改运行容器的端口
|
20小时前
|
数据管理 Linux Docker
docker 数据管理 与容器互联
docker 数据管理 与容器互联
|
2天前
|
Linux Docker 容器
蓝易云 - 【Linux】如何在linux系统重启或启动时执行命令或脚本(也支持docker容器内部)
以上就是在Linux系统和Docker容器中设置启动时运行命令或脚本的方法。希望对你有所帮助。
16 0
|
2天前
|
大数据 Linux Docker
mac docker 宿主机和容器间网络打通
mac docker 宿主机和容器间网络打通
6 0
http://www.vxiaotou.com