没想到国内源死差不多了,以下内容需要提前科学上网
su
cd /etc/systemd/system/docker.service.d
vim proxy.conf
参照下图修改,代理服务器改成你自己的。
[Service]
Environment="HTTP_PROXY=socks5://192.168.176.180:10810"
Environment="HTTPS_PROXY=socks5://192.168.176.180:10810"
Environment="NO_PROXY=localhost,127.0.0.1,.example.com"
然后重启一下docker
systemctl daemon-reload &systemctl restart docker
成功!