Carlos Vargas

Docker Containers behind a proxy

Blog Post created by Carlos Vargas Employee on Aug 2, 2016



I was designing a solution with a team to the best architects in the industry and we hit a road block. The solution was going to be deployed in an environment where there was a proxy.  Everything in the Linux OS worked with proxy but all the sudden docker will not connect to the registry to download what it needed.

After doing some research and reading a ton of posts here is a quick guide how to setup your docker environment if you have a proxy.


First, create a systemd drop-in directory for the docker service:


mkdir /etc/systemd/system/docker.service.d


Edit the configuration file for docker environment

Now create a file called /etc/systemd/system/docker.service.d/http-proxy.conf that adds the HTTP_PROXY environment variable:


sudo vi /etc/systemd/system/docker.service.d/http-proxy.conf






Proxy Bypass List

If you have internal Docker registries that you need to contact without proxying you can specify them via the NO_PROXY environment variable:






Flush changes

sudo systemctl daemon-reload


Verify that the configuration has been loaded


sudo systemctl show docker --property Environment




Restart Docker

sudo systemctl restart docker





Original Post: Docker Containers behind a proxy – Container King


Hitachi Developer Network