boot2docker:没有路由到主机

我无法让Docker Toolbox for Windows 10在公司代理之后工作。

我不能得到dockerlogin或docker运行工作,所以这是我已经做了debugging。

我在虚拟机中创build了一个普通的ubuntu机器。

在我的主机上,我开始在端口8000上运行简单的服务器。

在Ubuntu中:

$ curl 10.0.2.2:8000 $ [it retrieves the html being served] $ curl www.google.com $ curl (7) Failed to connect to www.google.com port 80: Connection refused $ export http_proxy=http://my-proxy:3128 $ curl www.google.com $ [302 HTTP response from google] 

在boot2docker上:

 $ curl 10.0.2.2:8000 $ [it retrieves the html being served] $ curl www.google.com $ curl (7) Failed to connect to www.google.com port 80: Connection refused $ export http_proxy=http://my-proxy:3128 $ curl www.google.com $ curl: (7) Failed to connect to my-proxy:3128: No route to host 

这里发生了什么?

好的,我终于解决了这个问题。

问题在于公司代理存在于默认泊坞窗VM桥的相同子网中。 (即172.17.xx)。

只是一个快速的解决方法 – 你可以通过在docker虚拟机中改变它来解决这个问题。

 $ docker-machine ssh mydockervm $ ifconfig docker0 172.18.0.1 netmask 255.255.0.0