name
argument:name
argument on the command line when we invoke earthly
:earthly +hello --name=world
, we will see that the echo command is cached (and won't re-display the hello world text):name
(which has a default value of John), with the current time:EARTHLY_BUILD_ARGS
environment variableEARTHLY_BUILD_ARGS
environment variable.EARTHLY_BUILD_ARGS
environment variable may also be stored in your ~/.bashrc
file, or some other shell-specific startup script..env
file.env
file to contain the build arguments to pass to earthly. First create an .env
file with:greetings
target which calls +hello
multiple times:earthly +greetings
, earthly will call +hello
three times:BUILD
command, build args can also be used with FROM
, COPY
, WITH DOCKER --load
and a number of other commands:$(...)
. For example, in the following, the value of the arg name
will be set as the ouptut of the shell command echo world
(which, of course is simply world
):RUN
command that is permitted to access them.+secrets/passwd
and exposes it under the environment variable mypassword
:+secrets/passwd
and exposes it under the environment variable passwd
you can use the shorthand :+secrets/passwd
in examples above must then be supplied when earthly is invoked.EARTHLY_SECRETS
.env
file..env
file in the same directory where you plan to run earthly
from. Its contents should be:echo "hello $name"
is changed to echo "greetings $name"
), or when one of its inputs has changed (e.g. --name=world
is changed to --name=banana
). Earthly creates a hash based on both the contents of the command and the contents of all defined arguments of the target build context.RUN
command that requires a secret is evaluated by BuildKit, the BuildKit daemon will request the secret from the earthly command-line process and will temporarily mount the secret inside the runc container that is evaluating the RUN
command. Once the command finishes the secret is unmounted. It will not persist as an environment variable within the saved container snapshot. Secrets will be kept in-memory until the earthly command exits.earthly secrets set ...
command to transmit the secret to the earthly cloud-based secrets server. For more information about cloud-based secrets, check out our cloud-based secrets management guide.