环境:vmware;debian 12.6;docker latest
目前不知道原理,直接照抄
PS:看上去是docker会有默认的读取逻辑,以后有机会继续深入了解
- 创建目录
mkdir -p /etc/systemd/system/docker.service.d
vim /etc/systemd/system/docker.service.d/proxy.conf
- 设置文件内容,里面填写对应的ip地址和端口
[Service]
Environment="HTTP_PROXY=http://{serverip}:{port}/"
Environment="HTTPS_PROXY=http://{serverip}:{port}/"
Environment="NO_PROXY=localhost,127.0.0.1"
- 重启docker
systemctl daemon-reload
systemctl restart docker
- 查看现在的代理
systemctl show --property=Environment docker
标签:systemd,代理,备忘,Environment,systemctl,PROXY,docker,Docker
From: https://www.cnblogs.com/licanghao/p/18329871