You referenced to a wrong document, the method mentioned in configure-the-docker-client
is all about how to set default proxy for containers, not for docker daemon
, while docker daemon
is the program who responsible for pull docker image.
The correct step is as next:
mkdir -p /etc/systemd/system/docker.service.d
new a file /etc/systemd/system/docker.service.d/http-proxy.conf
with something like next:
[Service]
Environment="HTTP_PROXY=http://proxy.example.com:80"
Environment="HTTPS_PROXY=https://proxy.example.com:443"
Environment="NO_PROXY=localhost,127.0.0.1,docker-registry.example.com,.corp"
restart the docker daemon with next:
systemctl daemon-reload
systemctl restart docker
NOTE: above things need be executed with sudo/root.
You should see next after check docker info
if you are successful:
$ docker info | grep Proxy
HTTP Proxy: http://proxy.example.com:80
HTTPS Proxy: https://proxy.example.com:443
No Proxy: localhost,127.0.0.1,docker-registry.example.com,.corp
Details refers to official document.