在Windows上通过Docker Toolbox运行Hello world时出错:“docker守护程序未运行”

时间:2018-01-21 19:20:46

标签: docker docker-toolbox

我是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...

1 个答案:

答案 0 :(得分:0)

请尝试:

docker-machine ls

可能它处于超时状态。所以停止它:

docker-machine stop dev

并关闭终端泊坞窗。 重新启动Docker快速启动终端,它应该工作正常。 请注意它不会挂起但比之前运行的时间长一点。我想下次你跑的时候可能会恢复正常。

这是Windows版本的一个已知错误(可能永远不会与Linux标准相比)。

如果不起作用,请在停止部分后重试此尝试从VBOX中删除VM。

如果有帮助,请告诉我。