docker build --build-arg=


執行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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM