- 修改配置文件
nano /usr/lib/systemd/system/docker.service
下面添加内容
[Service]
Restart=always
Environment="HTTP_PROXY=http://127.0.0.1:6790/"
Environment="HTTPS_PROXY=http://127.0.0.1:6790/"
Environment="NO_PROXY=localhost,127.0.0.1,.example.com"
- 重载配置
sudo systemctl daemon-reload
sudo systemctl restart docker