You can use ARG variable defaultValue
and during the run command you can even update this value using --build-arg variable=value
. To use these variables in the docker file you can refer them as $variable
in run command.
Note: These variables would be available for Linux commands like RUN echo $variable
and they wouldn't persist in the image.