centos7 docker使用https_proxy 代理配置

###centos7 docker使用https_proxy 代理配置docker

在centos6版本若是你配置docker 的https_proxy 代理,只须要在/etc/sysconfig/docker 配置文件里面增长配置便可,但在centos7 你会发现已经没法使用这样的配置方式进行https_proxy 配置,由于centos使用systemd 来管理进程环境,咱们须要以下配置来应用https_proxy 配置centos


建立目录centos7

mkdir /etc/systemd/system/docker.service.d

建立文件代理

touch /etc/systemd/system/docker.service.d/http-proxy.conf

配置http-proxy.conf文件增长如下内容rest

[Service]
Environment="HTTP_PROXY=http://proxy.ip.com:80"

daemon从新reload 并重启dockercode

systemctl daemon-reload
systemctl restart docker

检查变量是否加载进程

systemctl show docker --property Environment
相关文章
相关标签/搜索