- 建立檔案
mkdir -p /etc/systemd/system/docker.service.d
vim /etc/systemd/system/docker.service.d/http-proxy.conf
- 輸入內容
[Service]
Environment="HTTP_PROXY=http://192.168.8.125:10819"
Environment="HTTPS_PROXY=http://192.168.8.125:10819"
Environment="NO_PROXY=your-registry.com,10.10.10.10,*.example.com"
- 將其中ip換成機器ip以及梯子埠,重啟docker
systemctl daemon-reload
systemctl restart docker