配置Docker代理已实现外网访问


版本:

OS: CentOS 7.4

Docker: 17.09

 

For setting up proxy for docker, please do the following:


1.Create a systemd drop-in directory for the docker service:

 #mkdir -p /etc/systemd/system/docker.service.d
 #vim /etc/systemd/system/docker.service.d/http-proxy.conf
   
    [Service]
      Environment="HTTP_PROXY=http://username:password@172.16.3.139:3128"

 

2.For HTTPS proxy server:

 #vim /etc/systemd/system/docker.service.d/https-proxy.conf

   [Service]
     Environment="HTTPS_PROXY=http://username:password@172.16.3.139:3128"

 

3.Flush changes execute: 

#systemctl daemon-reload

 

4.Restart Docker:

#systemctl restart docker 

 

5.Verify that the configuration has been loaded: 

#systemctl show --property=Environment docker

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM