docker build 设置代理

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

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

查看所有标签

猜你喜欢:

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

Head Rush Ajax

Head Rush Ajax

Brett McLaughlin、Eric Freeman、Elisabeth Freeman / O'Reilly Media, Inc. / 2006-03-01 / USD 34.99

Ajax, or Asynchronous JavaScript and XML, is a term describing the latest rage in web development. Ajax is used to create interactive web applications with XML-based web services, and using JavaScript......一起来看看 《Head Rush Ajax》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

URL 编码/解码
URL 编码/解码

URL 编码/解码

MD5 加密
MD5 加密

MD5 加密工具