ARG defines a variable that users can pass at build-time to the builder with the docker build command using the --build-arg = flag. If a user specifies a build argument that was not defined in the Dockerfile, the build outputs an error.


ARG user1           # Defines an build argument called 'user1' without any default values
ARG buildno         # Defines an build argument called 'buildno' without any default values

ARG user1=someuser  # Defines and declares a default value for the build argument 'user1'
ARG buildno=123     # Defines and declares a default value for the build argument 'buildno'