码迷,mamicode.com
首页 > 其他好文 > 详细

Docker proxy

时间:2019-04-09 18:59:11      阅读:186      评论:0      收藏:0      [点我收藏+]

标签:sysconf   cal   window   spec   hat   eth   for   try   localhost   

Method One:


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


[Service]
Environment="HTTP_PROXY=http://xx:80/"
Environment="HTTPS_PROXY=https://xx:80/"


If you have internal Docker registries that you need to contact without proxying you can specify them via the NO_PROXY environment variable:

Environment="HTTP_PROXY=http://proxy.example.com:80/"
Environment="NO_PROXY=localhost,127.0.0.0/8,docker-registry.somecorporation.com"

#Flush changes:
$ sudo systemctl daemon-reload


#Verify that the configuration has been loaded:
$ sudo systemctl show --property Environment docker
Environment=HTTP_PROXY=http://proxy.example.com:80/

#Restart Docker:
$ sudo systemctl restart docker


Method Two:

sudo HTTP_PROXY=http://192.168.1.1:3128/ docker pull busybox


Method Three:

vim /etc/default/docker
service docker restart

CentoOs:/etc/sysconfig/docker

Addition:
If you‘re using the new Docker for Mac (or Docker for Windows), just right-click the Docker tray icon and select Preferences (Windows: Settings),
then go to Advanced, and under Proxies specify your proxy settings there. Click Apply and Restart and wait until Docker restarts.

Docker proxy

标签:sysconf   cal   window   spec   hat   eth   for   try   localhost   

原文地址:https://www.cnblogs.com/seeken/p/10678595.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!