執行Docker build時,有部分需要vpn的需求,通過引入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
