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

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

ubuntu安装好docker,执行了命令“sudo docker run hello-world”之后报错:

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

user@DESKTOP-QB5ALJE:~$ sudo docker run hello-world
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.

解决办法:

先运行下面的命令:sudo service docker start  * Starting Docker: docker

再运行:sudo docker run hello-world

成功解决~

user@DESKTOP-QB5ALJE:~$ sudo service docker start  * Starting Docker: docker
 * Starting Docker: docker                                                                                                                                                            [ OK ]
user@DESKTOP-QB5ALJE:~$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
2db29710123e: Pull complete
Digest: sha256:bfea6278a0a267fad2634554f4f0c6f31981eea41c553fdf5a83e95a41d40c38
Status: Downloaded newer image for hello-world:latest
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/
For more examples and ideas, visit:
 https://docs.docker.com/get-started/


相关文章
|
2月前
|
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
|
2月前
|
关系型数据库 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’
160 0
|
5月前
|
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
|
6月前
|
应用服务中间件 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` 命令即可。
281 0
|
6月前
|
Ubuntu Cloud Native Unix
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
|
14天前
|
存储 Docker 容器
docker中挂载数据卷到容器
【10月更文挑战第12天】
41 5
|
2天前
|
Docker 容器
docker 修改容器内的系统时间
【10月更文挑战第27天】docker 修改容器内的系统时间
47 2
|
8天前
|
Web App开发 iOS开发 Docker
Docker 容器的日志
【10月更文挑战第31天】
19 5
|
8天前
|
存储 缓存 Docker
docker中挂载数据卷到容器
【10月更文挑战第16天】
17 2
|
10天前
|
存储 关系型数据库 MySQL