proxy in docker

  1. Create directory
1
mkdir -p /etc/systemd/system/docker.service.d
  1. create proxy file
1
vim /etc/systemd/system/docker.service.d/http-proxy.conf
  1. modify file
1
2
[Service]
Environment="HTTPS_PROXY=http://username:password@192.168.1.1:8080" "NO_PROXY=localhost,127.0.0.1"
  1. save & flush
1
2
systemctl daemon-reload
systemctl restart docker
  1. verify
1
systemctl show --property=Environment docker

https://www.cnblogs.com/atuotuo/p/7298673.html
https://docs.docker.com/config/daemon/systemd/#httphttps-proxy