Comment on page
Global configuration values for earthly can be stored on disk in the configuration file.
By default, earthly reads the configuration file
~/.earthly/config.yml; however, it can also be overridden with the
--configcommand flag option.
Specifies the total size of the BuildKit cache, in MB. The BuildKit daemon uses this setting to configure automatic garbage collection of old cache. Setting this to 0, either explicitly or by omission, will cause buildkit to use its internal default of 10% of the root filesystem.
Specifies the total size of the BuildKit cache, as a percentage (0-100) of the total filesystem size. When used in combination with
cache_size_mb, the lesser of the two values will be used. This limit is ignored when set to 0.
A custom user-supplied program to call which returns a secret for use by earthly. The secret identifier is passed as the first argument to the program.
If no secret is found, the program can instruct earthly to continue searching for secrets under
.secret, by exiting with a status code of
2, all other non-zero status codes will cause earthly to exit.
For example, if you have:
my-secret-provider(which is accessible on your
if [ "$1" = "mysecret" ]; then
echo -n "open sesame"
Then when earthly encounters a command that requires a secret, such as
RUN --secret mysecret echo "the passphrase is $mysecret."
earthly will request the secret for
All stdout data will be used as the secret value, including whitespace (and newlines). You may want to use
echo -nto prevent returning a newline.
Any data sent to stderr will be displayed on the earthly console, this makes it possible to insert commands such as
echo >&2 "here is some debug text"without affecting the contents of the secret.
When set to true, disables collecting command line analytics; otherwise, earthly will report anonymized analytics for invocation of the earthly command. For more information see the data collection page.
When set to true, disables sharing build logs after each build. This setting applies to logged-in users only.
The number of concurrent converters for speeding up build targets that use blocking commands like
WITH DOCKER --load,
FROM DOCKERFILEand others.
The maximum parallelism configured for the buildkit daemon workers. The default is 20.
Set this configuration to a lower value if your machine is resource constrained and performs poorly when running too many builds in parallel.
This option allows you to pass additional options to Docker when starting up the Earthly BuildKit daemon. Note that changes to these values will trigger earthly to restart buildkit on the next run.
--usernsflag can be set as follows:
buildkit_additional_args: ["--userns", "host"]
By default, Buildkit will automatically cancel sessions (i.e. individual builds) after 24 hours. This value can be overriden using the following option:
buildkit_additional_args: ["-e", "BUILDKIT_SESSION_TIMEOUT=72h"]
Note that setting a value of zero
0here will disable the feature entirely. This can be useful in cases where long-lived interactive sessions are used.
This option allows you to pass additional options to BuildKit. Note that changes to these values will trigger earthly to restart buildkit on the next run.
Additional CA certificates can be passed in to buildkit. This also requires a corresponding change in
buildkit_additional_args: ["-v", "<absolute-path-to-ca-file>:/etc/config/add.ca"]
Allows overriding Earthly's automatic MTU detection. This is used when configuring the BuildKit internal CNI network. MTU must be between 64 and 65,536.
Allows overriding Earthly's automatic
ip_tablesmodule detection. Valid choices are
This option is obsolete and it is ignored. Earthly no longer uses a loop device for its cache.
Allows to override the image used to run internal
gitcommands (e.g. during
IMPORT). This defaults to
The default organization to use when performing Earthly operations that require an organization. Ignored when the
--orgCLI option is present, or when the
EARTHLY_ORGenvironment variable are set.
This option allows you to specify what supported frontend you are using (Docker / Podman). By default, Earthly will attempt to discover the frontend in this order: Docker -> Podman -> None
You can use the following command to set the configuration option using the earthly CLI:
earthly config 'global.container_frontend' 'docker-shell'
earthly config 'global.container_frontend' 'podman-shell'
All git configuration is contained under site-specific options.
The git repository hostname. For example
httpsis specified, user and password fields are used to authenticate over HTTPS when pulling from git for the corresponding site. If
autois specified earthly will use
sshwhen the ssh-agent is running and has at least one key loaded, and will fallback to using
httpswhen no ssh-keys are present.
The HTTPS username to use when auth is set to
https. This setting is ignored when auth is
The HTTPS password to use when auth is set to
https. This setting is ignored when auth is
strict_host_key_checkingoption can be used to control access to ssh-based repos whose key is not known or has changed. Strict host key checking is enabled by default, setting it to
falsedisables host key checking. This setting is only used when auth is
Disabling strict host key checking is a bad security practice (as it makes a man-in-the-middle attack possible). Instead, it's recommended to record the host's ssh key to
~/.ssh/known_hosts; this can be done by running
ssh-keyscan <hostname> >> ~/.ssh/known_hosts
Connect using a non-standard git port, e.g.
prefixoption is used to indicate where git repositories are stored on the server, e.g.
A regular expression defined to match git URLs, defaults to the
<site>/([^/]+)/([^/]+). For example if the site is
github.com, then the default pattern will match
If specified, a regular expression substitution will be performed to determine which URL is cloned by git. Values like
$2, ... will be replaced with matched subgroup data. If no substitute is given, a URL will be created based on the requested SSH authentication mode.