Configure proxy for docker

Create a systemd drop-in directory for the docker service

$ sudo mkdir -p /etc/systemd/system/docker.service.d

Add proxy configuration into /etc/systemd/system/docker.service.d/http-proxy.conf (create if not exist)

[Service]
Environment="HTTP_PROXY=<your_proxy>"
Environment="HTTPS_PROXY=<your_proxy>/"
Environment="NO_PROXY=localhost,127.0.0.1"

Flush change and restart service

$ sudo systemctl daemon-reload
$ sudo systemctl restart docker