$ mkdir /etc/systemd/system/docker.service.d/
$ cat >/etc/systemd/system/docker.service.d/proxy.conf << EOF
[Service]
Environment=HTTP_PROXY=http://myproxy:3128/
EOF
$ systemctl daemon-reload
$ systemctl restart docker.service
$ mkdir /etc/systemd/system/docker.service.d/
$ cat >/etc/systemd/system/docker.service.d/proxy.conf << EOF
[Service]
Environment=HTTP_PROXY=http://myproxy:3128/
EOF
$ systemctl daemon-reload
$ systemctl restart docker.service
转载于:https://www.cnblogs.com/mjaioy/p/4079180.html