Args are processed as build time environment variables, the docker build process itself is not parsing the variables.
This means you can see them with env
and perform shell processing on the variables that you cannot do in a Dockerfile.
After this line, any RUN
line will be a cache miss if the arg value changes.
You can see the variable set in the env
output even though the arg was not used in the RUN
command directly.
The prefix and suffix syntaxes are available inside busybox or bash, but not in the Dockerfile. You can see the variable substitution happens inside the container, not by the build engine parsing the Dockerfile.
The arg is no longer set here. It's only available on build steps inside the above Dockerfile, and even then, only
as part of the FROM
section. A multi-stage build would need to define the arg inside of each stage to use it again.