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

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:[email protected]:3128"

2.For HTTPS proxy server:

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

   [Service]
     Environment="HTTPS_PROXY=http://username:[email protected]: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

猜你喜欢

转载自www.cnblogs.com/dinglin1/p/8939978.html
今日推荐