08月15, 2019

Windows Docker Toolbox 安装之后无法运行

最近在 Windows10 下使用 Docker ,由于系统限制,只能选择使用 Docker Toolbox

安装和启动都没有问题,使用 Docker Quickstart Terminal 打开终端使用也没有问题。

当使用 cmd.exe 或者其他终端运行时,就报错了。

error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.26/containers/json: 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

谷歌之后,在 docker/toolbox 仓库看到一个 issues ,有六十多个人在讨论这个问题,看来问题很普遍啊。

经过一番查找加尝试找到解决方案:

  1. cmd.exe 等自带终端

    执行如下命令:

    @FOR /f "tokens=*" %i IN ('docker-machine env default') DO @%i
    
  1. babun.exe 等第三方类 unix 终端

    执行如下命令:

    eval $(docker-machine env default)
    

完美解决!

本文链接:http://blog.guansixu.cn/post/docker-toolbox-cannot-run.html

-- EOF --

Comments