Ubuntu 16.04 - Running container behind HTTP Proxy


Need information on configuring http proxy for containers. I have configured as below.

  1. Base OS - Ubuntu 16.04
  2. Have enabled the http_proxy variable in /etc/environment and also in the /etc/default/docker file.
  3. Updated the the Environment (http_proxy) variable in /etc/systemd/system/docker.service.d/http-proxy.conf

When we launch a container with the above setting in place, the http_proxy doesn’t show up any values inside the container. The container is not able to access the internet. But once we set the http_proxy variable from inside the container, it is working fine.

Do we need to pass the http_proxy as an environmental variable while launching the container ? Is it mandatory ? Would it not take the values set from the above settings ? Pls let me know if I am missing anything in the configuration ?

Did you get any solution? I have the same issue with you on the same OS env.

BTW, I tried to set the proxy inside the container, still can’t work. Could you tell how did you set proxy inside the container? Thanks very much