I am trying to pull images behind a proxy.
~/.docker/config.json :{
"proxies":
{
"default":
{
"httpProxy": "...",
"httpsProxy": "..."
}
}
}
Setted $DOCKER_CONFIG as [asbolute_path]/my_home/.docker
Restarted docker daemon: sudo systemctl restart docker
Not working.
Documentation I followed :
https://docs.docker.com/network/proxy/#configure-the-docker-client
Any tips ?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With