2

I'm having trouble getting Docker Toolbox for Windows 10 working behind a company proxy.

I can't get docker login or docker run to work, so here's what I've done to debug.

I created an plain ubuntu machine within a virtual machine.

On my host machine, I start simple server running on port 8000.

In 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]

On 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

What's going on here?

dwjohnston
  • 11,163
  • 32
  • 99
  • 194

2 Answers2

5

Ok, I finally solved this.

The issue was that the company proxy exists in the same subnet as the default docker VM bridge. (ie. 172.17.x.x).

Just a quick workaround - you can solve this by changing it within the docker VM.

$ docker-machine ssh mydockervm

$ ifconfig docker0 172.18.0.1 netmask 255.255.0.0
dwjohnston
  • 11,163
  • 32
  • 99
  • 194
3

I have experiment the same problem and I use @dwjohnston own answer to find the cause of the issue.

In my case the a docker VM bridge in conflict was related to the execution of an old docker-compose.

I solve that running :

$ docker network prune 

In order to clean the network connections...

The strange point about this is that the bridge was still mapped event if all the containers started by the compose have had been already pruned.

Note : this seems to be a "I have the same issue " answer, but the given solution is different...different...

Guillaume Barré
  • 4,168
  • 2
  • 27
  • 50