Skip to content

Instantly share code, notes, and snippets.

@islishude
Created September 9, 2019 00:55
Show Gist options
  • Save islishude/98b36a3e979a79bbbee9b3f350da9008 to your computer and use it in GitHub Desktop.
Save islishude/98b36a3e979a79bbbee9b3f350da9008 to your computer and use it in GitHub Desktop.
set http proxy for docker pull
$ sudo mkdir -p /etc/systemd/system/docker.service.d
$ edit /etc/systemd/system/docker.service.d/http-proxy.conf
[Service]
Environment="HTTP_PROXY=http://proxy.example.com:80/"
Environment="HTTPS_PROXY=http://proxy.example.com:80/"
Environment="NO_PROXY=localhost,127.0.0.1,docker-registry.example.com,.corp"
$ sudo systemctl daemon-reload
$ $ sudo systemctl restart docker
$ systemctl show --property=Environment docker
Environment=HTTP_PROXY=http://proxy.example.com:80/

see https://docs.docker.com/config/daemon/systemd/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment