CentOS 7 使用 systemd 管理服務,因此 Docker 的代理設定與 CentOS 6 不同。
mkdir /etc/systemd/system/docker.service.d
touch /etc/systemd/system/docker.service.d/http-proxy.conf
內容可加入:
[Service] Environment="HTTP_PROXY=https://proxy.ip.com:80"
systemctl daemon-reload systemctl restart docker
systemctl show docker --property Environment