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


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

相关文章
|
9月前
|
Ubuntu Linux Shell
(已解决)Linux环境—bash: wget: command not found; Docker pull报错Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled
(已成功解决)Linux环境报错—bash: wget: command not found;常见Linux发行版本,Linux中yum、rpm、apt-get、wget的区别;Docker pull报错Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled
4305 69
(已解决)Linux环境—bash: wget: command not found; Docker pull报错Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled
|
8月前
|
关系型数据库 MySQL Docker
docker pull mysql:8.0.26提示Error response from daemon: Get “https://registry-1.docker.io/v2/“: EOF错误
docker pull mysql:8.0.26提示Error response from daemon: Get “https://registry-1.docker.io/v2/“: EOF错误
|
12月前
|
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
271 1
|
12月前
|
关系型数据库 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’
1072 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"错误
120 0
|
Docker 容器
waiting for docker daemon: failed to start docker engine: dockerd failed to start: exit status 1
waiting for docker daemon: failed to start docker engine: dockerd failed to start: exit status 1
236 0
|
应用服务中间件 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` 命令即可。
1095 0
|
Unix Shell Linux
在Unix/Linux操作系统中,Shell脚本广泛用于自动化任务
在Unix/Linux操作系统中,Shell脚本广泛用于自动化任务
159 2
|
7月前
|
安全 Unix Linux
Unix:Linux的“祖师爷”
Unix的诞生 Unix操作系统诞生于1969年,由肯·汤普逊(Kenneth Lane Thompson)和丹尼斯·里奇(Dennis MacAlistair Ritchie)在AT&T的贝尔实验室开发。其初衷是为了在闲置的PDP-7计算机上开发一个简单的操作系统,以便进行编程和游戏。最初的Unix是用汇编语言编写的,但随后为了更高效的开发和更好的可移植性,里奇和汤普逊用C语言重写了Unix的大部分代码,这奠定了Unix的基础,并促进了C语言的广泛应用。
152 2
|
9月前
|
Unix Linux 编译器
UNIX/Linux 上的安装
UNIX/Linux 上的安装。
118 2