docker build时怎么用http proxy代理?
PHP中文网
PHP中文网 2017-04-24 09:10:22
0
3
1058

dockerfile里面

RUN apt-get update && apt-get install

build的时候比较慢,想在build期间用http代理,用prioxy到127.0.0.1:8118,firefox里面代理可用,但docker build就是不行

google出来github issue里提到, docker版本1.10.3,命令试过下面的写法,都不行。

# docker build --build-arg HTTP_PROXY=http://127.0.0.1:8118 .
# docker build --build-arg=[HTTP_PROXY=http://127.0.0.1:8118] .
PHP中文网
PHP中文网

认证0级讲师

reply all(3)
洪涛

Each RUN line is run in a temporary container, and the proxy of the host cannot be connected using 127.0.0.1 in the container

PHPzhong

It is best to connect to a VPN, which acts as a global proxy and does not require any parameters.

刘奇

Isn’t it possible to directly set the two environment variables http_proxy and https_proxy?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!