I have a Dockerfile that needs to download a specific version of a software from an URL with the ENV command. Such as:
In Dockerfile:
FROM ubuntu
ENV sw_ver=1.2.3
ADD https://some_address/_name_$sw_ver /some_dir
The build command is analogous to this:
docker build -t my_image:1.2.3 .
Now, it would be great if instead of setting the ENV variable, I could build different images for different versions of the software by simply varying the tag in my docker build command. So is it possible to read the tag number inside the Dockerfile and use it as a variable?