创建systemd的文件夹
mkdir -p /etc/systemd/system/docker.service.d
创建http-proxy配置文件
touch /etc/systemd/system/docker.service.d/http-proxy.conf
下面是具体的代理设置
Environment="HTTP_PROXY=http://proxy.example.com:80/" "NO_PROXY=localhost,127.0.0.1,docker-registry.somecorporation.com"
重启服务
systemctl daemon-reload
systemctl restart docker