Tag: proxy

Adding HTTP/HTTPS proxy for docker image downloads

As part of development your lab network or corporate network might be under a proxy network to download docker images.
This article explains on how to add HTTP/HTTPS proxy to download the docker images in a corporate environment.

Add the below lines

[Service]
Environment=”HTTP_PROXY=http://proxy.mycompany.com:80/”

in /etc/systemd/system/docker.service.d/http-proxy.conf

and

[Service]
Environment=”HTTPS_PROXY=https://proxy.mycompany.com:443/”

in /etc/systemd/system/docker.service.d/https-proxy.conf

Replace proxy.mycompany.com with your companies proxy server details.

Additionally add nameserver entry also to resolve hostnames.

#Use your DNS server details.
nameserver 172.10.22.1

in /etc/resolv.conf

Once added restart docker daemon and reload. Commands below.

$ sudo systemctl daemon-reload
$ sudo systemctl restart docker