Docker Community Forums

Share and learn in the Docker community.

Beta 13 didn't work with local proxy

beta

(Zzq889) #1

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

(Ritchiey) #2

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.


(Nacer) #3

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’.


(Foreverq) #4

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

(Dave Tucker) #5

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.


(Foreverq) #7

Thanks!

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


(Ddessy) #8

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


(Edwardc) #9

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


(Onigoetz) #10

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.


(Liucw) #11

Same issue to me …

Have simple solution?


(Robtruax) #12

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: