2025-1-20 myluzh
Docker
1、docker pull /push 的代理被 systemd 接管,所以需要设置 systemd
mkdir -p /etc/systemd/system/docker.service.d
touch /etc/systemd/system/docker.service.d/proxy.conf
vi /etc/systemd/system/docker.service.d/proxy.conf
2、编辑proxy.conf文件
# proxy.conf
[Service]
Environment="HTTP_PROXY=http://172.30.172.136:4780"
Environment="HTTPS_PROXY=http://172.30.172.136:4780"
Environment="NO_PROXY=localhost,127.0.0.1,.example.com,172.16.0.0/12"
3、重启docker服务
sudo systemctl daemon-reload
sudo systemctl restart docker
# 可以看到设置的环境变量
sud...
阅读全文>>
标签: docker docker代理 docker pull docker proxy
评论(0)
(20)