Docker抱怨ALL_PROXY环境变量带有“代理:未知方案:http”

I'm facing the following issue with my Docker containers: When I try to enter the container using

docker exec -it container-id /bin/bash

Docker (I assume it's Docker) complains with the following message:

proxy: unknown scheme: http

I have traced this back to the following environment variable that's set on my host machine, since I'm using a proxy server to access the web:

ALL_PROXY=http://myproxy:8080

The error message seems to come from the net/proxy.go file, which can be found here - the error message is issued on the last line of the file. Why would http not be a registered URL scheme in the Docker case?

As soon as I unset ALL_PROXY on the host, I can enter the container without any issues.

Environment:

  • Mac OS X v10.11.5
  • Docker v1.11.1
  • Docker-Machine v0.7.0

Any idea how to fix this (other than unsetting the variable each time)?

I am facing the same issue with docker 1.11.2. I believe the error is coming from method FromURL.

After checking the relevant commit https://github.com/docker/docker/commit/16effc66c028a7800096ed92174ca4bceba229ad, it turns out from v1.11.0-rc1 up to v1.12.0-rc4 are including this commit.

So the solution for me is to install a lower version (I used v1.10.3) of docker toolbox, after which "docker run hello-world" works.