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官方网站上的步骤操作。


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

相关文章
|
Docker 容器
14 response from daemon: open \\.\pipe\docker_engine_linux: The system cannot find the file speci
14 response from daemon: open \\.\pipe\docker_engine_linux: The system cannot find the file speci
532 1
|
NoSQL Redis Docker
5-11write /var/lib/docker/tmp/GetImageBlob2366037717: no space left on device
5-11write /var/lib/docker/tmp/GetImageBlob2366037717: no space left on device
|
关系型数据库 MySQL 数据库
docker启动mysql多实例连接报错Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’
docker启动mysql多实例连接报错Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’
1543 0
|
Kubernetes Linux Docker
【Azure 应用服务】使用Docker Compose创建App Service遇见"Linux Version is too long. It cannot be more than 4000 characters"错误
【Azure 应用服务】使用Docker Compose创建App Service遇见"Linux Version is too long. It cannot be more than 4000 characters"错误
298 0
|
Unix Go
cannot find package “golang.org/x/sys/unix“
cannot find package “golang.org/x/sys/unix“
307 0
|
存储 应用服务中间件 Docker
Docker容器无法启动Cannot find /usr/local/tomcat/bin/setclasspath.sh
根据具体情况,你可以尝试以上方法中的一个或多个,以解决 "Cannot find /usr/local/tomcat/bin/setclasspath.sh" 的问题。确保你的Docker容器中包含了完整且正确配置的Tomcat,并且相关文件和目录的权限设置正确。
940 0
|
Unix Shell Linux
在Unix/Linux操作系统中,Shell脚本广泛用于自动化任务
在Unix/Linux操作系统中,Shell脚本广泛用于自动化任务
299 2
|
Unix Shell Linux
在Linux和类Unix系统中,Shell提供了多种命令用于用户和权限管理
在Linux和类Unix系统中,Shell提供了多种命令用于用户和权限管理
253 4
|
安全 Unix Linux
Unix:Linux的“祖师爷”
Unix的诞生 Unix操作系统诞生于1969年,由肯·汤普逊(Kenneth Lane Thompson)和丹尼斯·里奇(Dennis MacAlistair Ritchie)在AT&T的贝尔实验室开发。其初衷是为了在闲置的PDP-7计算机上开发一个简单的操作系统,以便进行编程和游戏。最初的Unix是用汇编语言编写的,但随后为了更高效的开发和更好的可移植性,里奇和汤普逊用C语言重写了Unix的大部分代码,这奠定了Unix的基础,并促进了C语言的广泛应用。
447 2
|
Unix Linux 编译器
UNIX/Linux 上的安装
UNIX/Linux 上的安装。
250 2