Docker Community Forums

Share and learn in the Docker community.

Docker daemon not using proxy


(Sacchettom) #1

Hi all,
I’m in the process of evaluating Docker for possible use within the company. I’m trying to set it up into a local VirtualBox environment but so far I haven’t got a lot of luck. The virtual machine is a Centos 6.6 with the latest updates. I’m behind a corporate firewall which requires a login; I installed a local squid without caching which does the job of forwarding requests to the corporate proxy.
These are the local settings:

[root@localhost log]# env |grep proxy
http_proxy=http://127.0.0.1:3128/
https_proxy=http://127.0.0.1:3128/
no_proxy=.xxxxxx.com,.xxxxxx.co.uk,.xxxxxx.net,/var/run/docker.sock

The docker service starts the daemon nicely.

[root@localhost log]# docker version
Client version: 1.5.0
Client API version: 1.17
Go version (client): go1.3.3
Git commit (client): a8a31ef/1.5.0
OS/Arch (client): linux/amd64
Server version: 1.5.0
Server API version: 1.17
Go version (server): go1.3.3
Git commit (server): a8a31ef/1.5.0

The deamon though won’t connect to the internet at all:

[root@localhost log]# docker search centos
FATA[0063] Error response from daemon: Get https://index.docker.io/v1/search?q=centos: dial tcp 162.242.195.84:443: connection timed out

Of course if I try a curl on that address I get the json response without any trouble.
Looking at the squid logs, docker won’t even try to connect through the proxy. The documentantion says that docker should simply get the proxy settings from the environment, but it looks like that’s not the case. What should I try?


(Sacchettom) #2

Problem solved. As the daemon doesn’t launch in interactive mode, it looks like that the /etc/environment file, where I had the proxy vaiables, is ignored. Pushing the proxy settings inside the launching script works, until I find a better place for that.


(Fabien Balageas) #3

On RHEL7, I put my proxy settings in /etc/sysconfig/docker and it worked as expected.
Maybe you can also add these settings in /etc/default/docker.