Proxy settings for containers

Hello,

I’m new to docker and have been trying to follow some documentation to deploy some containers required for one of our tools. I can get most of it working but the proxy settings just don’t seem to be applied. When I say proxy settings, I mean for the containers and not the docker host/daemon etc.

I can pull images and run them. The issue arises when that image spins up another container that needs to have proxy configured but that one doesn’t seem to inherit the settings from the host.

I have tried following the documentation here but to no result.

The docker version I’m running is

Docker version 19.03.5, build 633a0ea

The config.json file is present in the default location /root/.docker and has the following content.

{
 "proxies":
 {
   "default":
   {
     "httpProxy": "http://<proxyhost>:<proxyport>",
     "httpsProxy": "http://<proxyhost>:<proxyport>",
     "noProxy": "*.domain.net,*.net,10.0.0.0/8"
   }
 }
}

I’ve tried making the proxy settings stick for the root user on the host etc. but nothing has worked.

What am I doing wrong? Any help is much appreciated.

Thanks,
Karan