Build દરમિયાન packages ડાઉનલોડ કરવા માટે Dockerfileના ENVમાં temporary route સાચવવાને બદલે Dockerના predefined proxy inputs વાપરો. 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 .

Documentation endpoint બદલો. --build-arg નામો પછી values ન આપો તો તે આ invocationના environmentમાંથી લેવામાં આવે છે. આ predefined inputs માટે ARG declarations જરૂરી નથી.

Docker ડિફૉલ્ટ રીતે આ proxy argumentsને build-cache handling અને docker historyમાંથી બહાર રાખે છે. Dockerfileમાં સ્પષ્ટ reference કરવાથી વર્તન બદલાય છે; બીજા build-argument ઉદાહરણમાં છે એટલા માટે declaration ઉમેરશો નહીં.

Process values મેળવે છે. Authenticated URL printed environment, logs, copied config અથવા પછીની image operations દ્વારા લીક થઈ શકે છે. 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 inputs daemonનું અગાઉનું registry pull અથવા unreachable remote builderનો host route કૉન્ફિગર કરતા નથી. પછી final image અને application configમાં persistent proxy values તપાસો.

સંબંધિત લેખો