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/


相关文章
|
3月前
|
安全 Linux 数据安全/隐私保护
docker运行报错docker: Error response from daemon: AppArmor enabled on system but the docker-default prof
docker运行报错docker: Error response from daemon: AppArmor enabled on system but the docker-default prof
65 0
|
2月前
|
Docker 容器
百度搜索:蓝易云【docker启动报错:Cannot connect to the Docker daemon】
通过以上方法,你应该能够解决“Cannot connect to the Docker daemon”错误,并成功启动Docker。如果问题仍然存在,可能需要检查其他系统配置或查看Docker日志以找出具体原因。
36 2
|
4月前
|
关系型数据库 MySQL Docker
查看docker run 时启动命令
查看docker run 时启动命令
127 0
|
4月前
|
Docker 容器
docker使用遇到问题Got permission denied while trying to connect to the Docker daemon socket
docker使用遇到问题Got permission denied while trying to connect to the Docker daemon socket
67 0
|
4月前
|
Docker 容器
百度搜索:蓝易云【docker篇-重启策略+run容器常用参数】
总结: 通过重启策略和 `docker run`的参数,你可以在Docker中管理容器的重启行为和配置。重启策略定义了容器在退出或崩溃后的重启行为,而 `docker run`的参数可以用来设置容器的其他行为,如运行模式、端口映射、文件挂载等。
71 0
|
Docker 容器
《容器技术系列》一3.2 Docker Daemon的启动流程
本节书摘来华章计算机《容器技术系列》一书中的第3章 ,第3.2节,孙宏亮 著, 更多章节内容可以访问云栖社区“华章计算机”公众号查看。 3.2 Docker Daemon的启动流程 Docker Daemon和Docker Client的启动均通过可执行文件docker完成,因此两者的启动流程非常相似。
1620 0
|
16天前
|
Docker 容器
进入Docker容器中
进入Docker容器中
32 2
|
1月前
|
Java Go 开发者
Docker容器技术简介及其与Go语言的结合点
【2月更文挑战第23天】本文首先概述了Docker容器技术的核心概念和优势,接着探讨了Go语言与Docker容器技术的结合点。通过阐述Docker的轻量级、可移植性和版本控制等特性,以及Go语言在容器化应用中的优势,本文旨在说明两者结合能够实现更高效、灵活的应用开发和部署。
|
1月前
|
Oracle 关系型数据库 数据库
|
5天前
|
Linux Docker 容器
docker 容器常用命令
docker 容器常用命令
10 0