且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

docker run hello-world 遇到错误消息 - error during connect

更新时间:2022-09-15 16:01:15

执行命令行:


docker run hello-world


docker run hello-world 遇到错误消息 - error during connect


遇到错误消息:


docker: error during connect: This error may indicate that the docker daemon is not running.: Post “http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/containers/create”: open //./pipe/docker_engine: The system cannot find the file specified.

See ‘docker run --help’.


错误消息里已经解释清楚原因了:docker daemon 没有启动。


进到文件夹:C:\Program Files\Docker\Docker


执行 DockerCli -switchDaemon 之后,


docker run hello-world 遇到错误消息 - error during connect


任务栏里看到这个 icon:


docker run hello-world 遇到错误消息 - error during connect

之后执行成功:


docker run hello-world 遇到错误消息 - error during connect

这条消息打印的背后,执行了这些事情:


(1) The Docker client contacted the Docker daemon.


Docker 客户端同 docker daemon 连接


(2) The Docker daemon pulled the “hello-world” image from the Docker Hub.

(windows-amd64, nanoserver-1809)


因为这个命令是第一次执行,Docker daemon 从 docker hub 网站,将 hello-world 镜像下载到本地。


(3) The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading.


Docker daemon 基于下载好的镜像,创建一个新的容器,后者运行镜像,产生一条输出消息


(4) The Docker daemon streamed that output to the Docker client, which sent it to your terminal.


Docker daemon 将输出发给 docker 客户端,后者再发到 Windows 控制台。