Last Updated on 2024-03-06 by likun.gong
编辑 /etc/systemd/system/docker.service.d/http-proxy.conf
,目录和文件没有就新建一下,然后配置代理内容如下:
[Service]
Environment="HTTP_PROXY=http://xxx.com:80"
Environment="HTTPS_PROXY=https://xxx.com:443"
Environment="NO_PROXY=xxx-registry.com,*.example.com"
重启 Docker
# 重启Docker
sudo systemctl daemon-reload
sudo systemctl restart docker
# 检查是否正确配置
sudo systemctl show --property=Environment docker
# 确认结果
sudo docker info
发表回复