I\'m attempting to set up a development environment behind a corporate proxy server with Docker. Try as I might, I cannot get the docker container to talk to the proxy server.>
The issue ended up being with DNS. Docker is running on Ubuntu, which is, itself, a Guest OS on VirtualBox. Due to it's own virutalizing mumbo jumbo, it assigned a nameserver of 127.0.0.1 in resolv.conf.
When this happens, Docker will assign itself a DNS nameserver of 8.8.8.8 (google's nameserver) since localhost refers to the docker container not the host.
To fix this, I went all the way out to Windows and ran
ipconfig /all
And got the IP address of my laptops DNS Servers. I added these to DOCKER_OPTS in the configuration file with --dns=my.dns.ip.address and restarted docker, and the other measures I took to get through the proxy worked fine.