在Windows上使用Docker Toolbox运行Hello world时出错:"docker守护进程未运行"。

3

我对Docker不太熟悉。我安装了Docker Toolbox,但在运行以下示例的Hello World时遇到了问题:

启动Docker QuickStart终端,结果如下:

             ##         .
              ## ## ##        ==
           ## ## ## ## ##    ===
       /"""""""""""""""""\___/ ===
  ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~
       \______ o           __/
         \    \         __/
          \____\_______/
Error getting IP address: ssh command error:
command : ip addr show
err : exit status 255
output : Warning: Identity file C:\Users#.lp.docker\machine\machines\default\id_rsa -p 22 "ip addr show" not accessible: No such file or directory.
docker is configured to use the default machine with IP
For help getting started, check out the docs at https://docs.docker.com

Start interactive shell

$ docker run hello-world
C:\Program Files\Docker Toolbox\docker.exe: error during connect: Post http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.35/containers/create: open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.
See 'C:\Program Files\Docker Toolbox\docker.exe run --help'.

$ docker --version
Docker version 18.01.0-ce, build 03596f51b1

下面的命令有时会一直运行:
PS C:\Users\'#.lp> docker-machine ls
NAME      ACTIVE   DRIVER       STATE     URL   SWARM   DOCKER   ERRORS
default            virtualbox   Timeout

我正在使用Docker Toolbox,因为由于其他错误无法运行Docker for Windows。

环境: Windows 10专业版。

更新 我从Virtual Box中删除了所有虚拟机,并打开了Docker QuickStart终端,但它一直在尝试获取IP,如下所示:

Running pre-create checks...
Creating machine...
(default) Copying C:\Users\'#.lp\.docker\machine\cache\boot2docker.iso to C:\Users\'#.lp\.docker\machine\machines\default\boot2docker.iso...
(default) Creating VirtualBox VM...
(default) Creating SSH key...
(default) Starting the VM...
(default) Check network to re-create if needed...
(default) Windows might ask for the permission to configure a dhcp server. Sometimes, such confirmation window is minimized in the taskbar.
(default) Waiting for an IP...

“docker-machine ls” 命令在 Docker 中有什么作用? - Black.Jack
请检查我的更新帖子。有时会一直运行。 - Pingpong
1个回答

0
请尝试以下操作:
docker-machine ls

可能是超时状态。因此,请使用以下命令停止它:

docker-machine stop dev

关闭终端Docker窗口。 重新启动Docker Quick Start终端,它应该可以正常工作。 请注意,它不会挂起,但运行时间可能比以前长一点。当你下次运行时,我认为它可能恢复正常。

这是Windows版本的已知错误(可能永远无法与Linux标准相比较......)。

如果不起作用,请尝试删除VBOX中的VM后再尝试此操作。

如果有帮助,请让我知道。


请查看我在帖子底部更新的内容。错误阻止了获取IP。 - Pingpong
从这里很难检测到。尝试在打开VirtualBox后启动Docker终端,也许暂时停止防病毒软件和防火墙。 - Black.Jack

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接