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
相關文章
相關標籤/搜索