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/


目录
打赏
0
1
0
0
203
分享
相关文章
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker
165 0
|
10月前
|
cannot find package “golang.org/x/sys/unix“
cannot find package “golang.org/x/sys/unix“
77 0
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
Linux(UNIX)五种网络I/O模型与IO多路复用
Linux(UNIX)五种网络I/O模型与IO多路复用
190 0
|
10月前
|
在Unix/Linux操作系统中,Shell脚本广泛用于自动化任务
在Unix/Linux操作系统中,Shell脚本广泛用于自动化任务
96 2
|
13天前
|
Unix:Linux的“祖师爷”
Unix的诞生 Unix操作系统诞生于1969年,由肯·汤普逊(Kenneth Lane Thompson)和丹尼斯·里奇(Dennis MacAlistair Ritchie)在AT&T的贝尔实验室开发。其初衷是为了在闲置的PDP-7计算机上开发一个简单的操作系统,以便进行编程和游戏。最初的Unix是用汇编语言编写的,但随后为了更高效的开发和更好的可移植性,里奇和汤普逊用C语言重写了Unix的大部分代码,这奠定了Unix的基础,并促进了C语言的广泛应用。
18 2
UNIX/Linux 上的安装
UNIX/Linux 上的安装。
66 2
操作系统的演化与比较:从Unix到Linux
本文将探讨操作系统的历史发展,重点关注Unix和Linux两个主要的操作系统分支。通过分析它们的起源、设计哲学、技术特点以及在现代计算中的影响,我们可以更好地理解操作系统在计算机科学中的核心地位及其未来发展趋势。
|
10月前
|
在Linux和类Unix系统中,Shell提供了多种命令用于用户和权限管理
在Linux和类Unix系统中,Shell提供了多种命令用于用户和权限管理
98 4
|
7月前
|
Unix:Linux的“逗趣祖师爷”与它的不凡传承
在科技长河中,Unix犹如一颗恒星,既是历史见证者也是未来的启发者。1969年,因程序员肯·汤普森想在他的PDP-7上玩“Space Travel”游戏,意外创造了Unix,以简洁优雅的代码改变了操作系统的世界。进入90年代,林纳斯·托瓦兹受Unix启发,开发了开源免费的Linux,像是Unix调皮的孙子,不仅继承其精髓还增添了开放共享的精神。Unix与Linux之间的传承,就像是智者与追蝶孩童的故事,充满了岁月的智慧与新生的活力,提醒我们科技传奇往往源于不起眼的小事。下次使用Linux时,不妨会心一笑吧!
97 0
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等