Docker - environment variable during build


Yes it is quite possible to set environment variable during build ,

Example snippet from Dockerfile,

RUN cd c:\app; .\some.install --version $($env:CLIVERSION)

If you notice code above, you can immediately tell that , $($env:VERSION)  is the variable. 

So when we  run it we do something like :-

docker build -t  netcorebuilder --build-arg VERSION=1.0.19

Comments

Popular posts from this blog

gemini cli getting file not defined error

NodeJS: Error: spawn EINVAL in window for node version 20.20 and 18.20

vllm : Failed to infer device type