docker daemon 配置代理

创建插件目录

sudo mkdir -p /etc/systemd/system/docker.service.d

编写proxy配置文件

#vim /etc/systemd/system/docker.service.d/http-proxy.conf
[Service]
Environment="HTTP_PROXY=http://proxy.server.com:913/" "HTTPS_PROXY=http://proxy.server.com:913/" "NO_PROXY=localhost,127.0.0.1,10.96.0.0/16, 10.244.0.0/16"

重启docker daemon

sudo systemctl daemon-reload
sudo systemctl restart docker

systemctl show --property=Environment docker

 

/etc/systemd/system/docker.service.d
posted @ 2019-04-12 17:28  chenzhenqi  阅读(1147)  评论(0编辑  收藏  举报