docker build 设置代理

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

内容简介: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 设置代理》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

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

Basics of Web Design

Basics of Web Design

Terry Felke-Morris / Addison-Wesley / 2013-1-28 / USD 98.40

Basics of Web Design: HTML5 and CSS3, 2e covers the basic concepts that web designers need to develop their skills: * Introductory Internet and Web concepts* Creating web pages with HTML5* Configurin......一起来看看 《Basics of Web Design》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具