Beta 13 didn't work with local proxy

Expected behavior

Pull images without the error below.

Actual behavior

Pulling repository docker.io/library/hello-world
Error while pulling image: Get https://index.docker.io/v1/repositories/library/hello-world/images: http: error connecting to proxy http://127.0.0.1:6152: dial tcp 127.0.0.1:6152: getsockopt: connection refused

Information

OS X: version 10.11.5 (build: 15F34)
Docker.app: version v1.11.1-beta13
Running diagnostic tests:
[OK]      Moby booted
[OK]      driver.amd64-linux
[OK]      vmnetd
[OK]      osxfs
[OK]      db
[OK]      slirp
[OK]      menubar
[OK]      environment
[OK]      Docker
[OK]      VT-x
Docker logs are being collected into /tmp/20160526-104005.tar.gz
Most specific failure is: No error was detected

Steps to reproduce the behavior

  1. setup local proxy
  2. export http_proxy=http://127.0.0.1:8080; export https_proxy=http://127.0.0.1:8080
  3. docker pull hello-world

Not an expert but this problem may be because the proxy is being set for the docker client but not docker engine.

The docker engine is already running before you set those environment variables.

Same here, i’m running a cntlm daemon on localhost and i get the error

docker run hello-world
Unable to find image ‘hello-world:latest’ locally
Pulling repository docker.io/library/hello-world
docker: Error while pulling image: Get https://index.docker.io/v1/repositories/library/hello-world/images: http: error connecting to proxy http://127.0.0.1:3130: dial tcp 127.0.0.1:3130: getsockopt: connection refused.
See ‘docker run --help’.

The same problem here. I’m running a local proxy on 127.0.0.1:6152 and I got the same error above.

Behavior

docker pull nginx

Pulling repository docker.io/library/nginx
Error while pulling image: Get https://index.docker.io/v1/repositories/library/nginx/images: http: error connecting to proxy http://127.0.0.1:6152: dial tcp 127.0.0.1:6152: getsockopt: connection refused

Information

OS X: version 10.11.5 (15F34)
Docker: version 1.11.1

Steps to reproduce the behavior

  1. setup a local proxy
  2. go to OS X System Preferences → Network → Advanced… → Proxies → Select either HTTP or HTTPS protocol and set 127.0.0.1 as Web Proxy Server
  3. docker pull nginx

Thanks for the bug report.
The issue here is that 127.0.0.1 - in this case, your Mac, is not reachable from the VM where docker is running.
We have issue (#3438) on our tracker open for this.

Thanks!

And are there any solutions or it should be fixed in the future version of Docker for Mac?

Hi Dave,

Issue is still present on beta 13.1 for Mac:

domi$ docker pull redis
Using default tag: latest
Pulling repository docker.io/library/redis
Error while pulling image: Get https://index.docker.io/v1/repositories/library/redis/images: http: error connecting to proxy http://127.0.0.1:8228: dial tcp 127.0.0.1:8228: getsockopt: connection refused

OS X: version 10.11.5 (build: 15F34)
Docker.app: version v1.11.1-beta13.1
Running diagnostic tests:
[OK] Moby booted
[OK] driver.amd64-linux
[OK] vmnetd
[OK] osxfs
[OK] db
[OK] slirp
[OK] menubar
[OK] environment
[OK] Docker
[OK] VT-x
Docker logs are being collected into /tmp/20160530-165331.tar.gz
Most specific failure is: No error was detected

Is there any work-around available? e.g. tricks with ifconfig aliases?

I think I found a solution.

I changed the proxy options in the docker preferences to http://192.168.65.1:3129 and it seems to work fine.

This seems to be the default address for the network with the docker host

How I found this address

I connected inside the xhyve VM with:

screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty

(user: root, no password)

Then running ifconfig
The list contains three networks : docker0, eth0 and lo.

eth0 seems to be the network connecting to the host. it’s ip is 192.168.65.2
By deduction I tried to telnet 192.168.65.1 3129 into my cntlm daemon. It seemed to work.

1 Like

Same issue to me …

Have simple solution?

I just tried this out (the 192.168.65.1 address) and it worked for me for my local cntlm. I’ve cross referenced this here:

1 Like