Docker Proxy

Setup docker proxy that affects all builds, even when it is not specify in the Dockerfile, which may be confusing on the next build when proxy is not required.

Docker Proxy
Photo by Rubaitul Azad / Unsplash

Docker Config

~/.docker/config.json

{
 "proxies": {
   "default": {
     "httpProxy": "http://proxy.example.com:3128",
     "httpsProxy": "https://proxy.example.com:3129",
     "noProxy": "*.test.example.com,.example.org,127.0.0.0/8"
   }
 }
}

Don't use the ENV Dockerfile instruction to specify proxy settings for builds. Use build arguments instead.