docker build 设置代理

栏目: 编程工具 · 发布时间: 8年前

内容简介:docker build 设置代理(金庆的专栏 2018.9)Dockerfile.frontendapi 中有

docker build 设置代理

(金庆的专栏 2018.9)

Dockerfile.frontendapi 中有 RUN go get , 需要设置代理。

docker build . -f Dockerfile.frontendapi \
	-t registry.cn-shanghai.aliyuncs.com/jinq0123/openmatch-frontendapi:dev \
	--network host \
	--build-arg HTTP_PROXY=http://127.0.0.1:1080 \
	--build-arg HTTPS_PROXY=http://127.0.0.1:1080

因为 docker build 会在一个容器内执行,所以须指定 network 为 host, 使之可以连接本机的代理。

[root@pppdc9prda2y java]# docker build 
  --build-arg https_proxy=$HTTP_PROXY --build-arg http_proxy=$HTTP_PROXY 
  --build-arg HTTP_PROXY=$HTTP_PROXY --build-arg HTTPS_PROXY=$HTTP_PROXY 
  --build-arg NO_PROXY=$NO_PROXY  --build-arg no_proxy=$NO_PROXY -t java .

以上所述就是小编给大家介绍的《docker build 设置代理》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。

PHP and MySQL Web Development

PHP and MySQL Web Development

Luke Welling、Laura Thomson / Sams / July 25, 2007 / $49.99

Book Description PHP and MySQL Web Development teaches you to develop dynamic, secure, commerical Web sites. Using the same accessible, popular teaching style of the three previous editions, this b......一起来看看 《PHP and MySQL Web Development》 这本书的介绍吧!

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具