बिल्डका बेला प्याकेज डाउनलोड गर्न Dockerfile को ENV मा अस्थायी मार्ग राख्नुको सट्टा Docker का पूर्वनिर्धारित proxy input प्रयोग गर्नुहोस्। POSIX invocation ले यो दिन सक्छ:

HTTP_PROXY=http://203.0.113.10:8080 \
HTTPS_PROXY=http://203.0.113.10:8080 \
docker build --build-arg HTTP_PROXY --build-arg HTTPS_PROXY .

कागजातको endpoint बदल्नुहोस्। --build-arg नामपछि मान नदिँदा यो invocation को environment बाट लिइन्छ। यी पूर्वनिर्धारित input का लागि मिल्ने ARG declaration आवश्यक छैन।

Docker ले यी proxy argument लाई build-cache handling र docker history बाट डिफल्ट रूपमा बाहिर राख्छ। Dockerfile मा स्पष्ट reference गर्दा व्यवहार बदलिन्छ; अर्को build-argument उदाहरणले गरेको भन्दै declaration नथप्नुहोस्।

Process ले मान पाउँछ। Authenticated URL printed environment, logs, copy गरिएको config वा पछिका image operation बाट चुहिन सक्छ। Dockerfile को ENV ले route लाई final image environment को भाग बनाउँछ।

Command लाई sensitive material चाहिँदा BuildKit secret mount ले build-time secret interface दिन्छ। Credential लाई त्यही operation मा सीमित राख्नुहोस्; mount print नगर्नुहोस् र content image layer मा copy नगर्नुहोस्।

यी build input ले daemon को अघिल्लो registry pull वा पहुँच नहुने remote builder को host route configure गर्दैनन्। पछि final image र application config मा persistent proxy value जाँच्नुहोस्।

सम्बन्धित लेखहरू