+dockertarget we can create an
ARGcalled tag. In this case, we give it a default value of
latest. If we do not provide a default value the default will be an empty string.
SAVE IMAGEcommand, we are able to reference the
$followed by the
my-new-image-tagwill override the default value and become the new tag for our docker image. If we hadn't passed in a value for tag, then the default
latestwould have been used.
ARGs when referencing a target inside an Earthfile. Using the
BUILDcommands, this looks pretty similar to what we did above on the command line.
ARGs when using the
COPYcommand, though the syntax is a little different.
ARGs they need to be pre-declared. Once you do that, you can use them just like any other
USERARCHwhich is a builtin that holds the processor architecture the target is being built from.