1

I apologise if I am posting this in the wrong section, I need some help and unsure where to turn to.

I am trying to run docker behind a proxy on a linux/ubuntu server machine. I have configured every proxy on the box (FTP/HTTPS/HTTP), I have also configured the Docker proxies mentioned here: https://docs.docker.com/config/daemon/systemd/#httphttps-proxy and https://stackoverflow.com/a/28093517/4261713

However, I have the docker service set to auto-start on machine boot, unless I log onto the machine and run sudo service docker restart those settings are ignored, and docker fails to use a proxy. This is all fine, we have a work around for local access, but I need to use this machine remotely using auto-builds/deployments etc. Therefore, the builds break without running that command.

Unfortunately I cannot get any help from Docker support, I have waited around 3 weeks for them to reply with no luck. This problem is more than likely me not understanding linux services/daemons. Can someone help me out?

To confirm what I have already tried:

  1. I have created the http-proxy.conf in /etc/systemd/system/docker.service.d and created the Environment variable there for the proxy.

  2. I have tried to modify the docker service init.d file by adding to the "DOCKER_OPTS" variable at the top using -e "HTTP_PROXY=http://addressofproxy:portofproxy" -e "HTTPS_PROXY=http://addressofproxy:portofproxy" However, this also has made no difference and I still need to restart the service after a reboot!

  3. I have also set/configured the client config in ~/.docker/config.json to have the proxies in.

Any assistance is much appreciated, I am totally stuck with why it wont read the options in on startup.

1 Answer 1

0

On OS running systemd you could try to add: /etc/systemd/system/docker.service.d/http-proxy.conf

with content:

[Service] Environment="HTTP_PROXY=http://proxy:3128/" "HTTPS_PROXY=http://proxy:3128/" "NO_PROXY=localhost,127.0.0.1"

then

systemctl daemon-reload systemctl restart docker

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .