美文网首页
Docker build 网络代理配置

Docker build 网络代理配置

作者: 酒馆_1916 | 来源:发表于2019-06-22 19:34 被阅读0次

执行Docker build时,有部分需要×××的需求,通过引入http_proxy 解决:

对第一种方法改进。在在Docker file 里面先写上,这种会增加镜像大小 

ENV http_proxy http://ip:port 

最后在把

ENV http_proxy ""

2、 在build 中加入参数解决:

docker build \

--build-arg http_proxy=http://10.188.61.2:8118 \

--build-arg https_proxy=https://10.188.61.2:8118 \

-f Dockerfile . -t imagename:tag

docker build \

--build-arg http_proxy=http://10.188.61.2:8118 \

--build-arg https_proxy=https://10.188.61.2:8118 \

-f Dockerfile . -t imagename

相关文章

网友评论

      本文标题:Docker build 网络代理配置

      本文链接:https://www.haomeiwen.com/subject/nywvqctx.html