Configure Docker to use a proxy server | Docker Documentation
docs.docker.com › network › proxyIf your container needs to use an HTTP, HTTPS, or FTP proxy server, you can configure it in different ways: In Docker 17.07 and higher, you can configure the Docker client to pass proxy information to containers automatically. In Docker 17.06 and earlier versions, you must set the appropriate environment variables within the container. You can do this when you build the image (which makes the image less portable) or when you create or run the container.
Using docker behind an http proxy with authentication | Mike ...
mikemylonakis.com › unix › docker-proxyDec 01, 2018 · Docker, however, is a daemon and is managed by systemd on the most popular Linux distributions, so we need to configure these environment variables in a different way. Systemd directives Permalink. According to the official documentation, we should create a file /etc/systemd/system/docker.service.d/http-proxy.conf with the following contents: [Service] Environment = "HTTP_PROXY=http://proxy.example.com:80/".