You can use ARG – see https://docs.docker.com/engine/reference/builder/#arg
The
ARGinstruction defines a variable that users can pass at
build-time to the builder with thedocker buildcommand using the
--build-arg <varname>=<value>flag. If a user specifies a build
argument that was not defined in the Dockerfile, the build outputs an
error.
Can be useful with COPY during build time (e.g. copying tag specific content like specific folders)
For example:
ARG MODEL_TO_COPY
COPY application ./application
COPY $MODEL_TO_COPY ./application/$MODEL_TO_COPY
While building the container:
docker build --build-arg MODEL_TO_COPY=model_name -t <container>:<model_name specific tag> .