Configuration reference
Global configuration values for earth can be stored on disk in the configuration file.
By default, earth reads the configuration file ~/.earth/config.yml; however, it can also be overridden with the --config command flag option.
Format
The earth config file is a YAML formatted file that looks like:
global:
cache_size_mb: <cache_size_mb>
git:
global:
url_instead_of: <url_instead_of>
<site>:
auth: https|ssh
user: <username>
password: <password>
<site2>: ...Example:
global:
cache_size_mb: 20000
git:
global:
url_instead_of: "git@example.com:=https://localmirror.example.com/"
github.com:
auth: https
user: alice
password: itsasecretGlobal configuration reference
cache_size_mb
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.
cache_size_pct
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.
secret_provider (experimental)
A custom user-supplied program to call which returns a secret for use by earth. The secret identifier is passed as the first argument to the program.
If no secret is found, the program can instruct earth to continue searching for secrets under .secret, by exiting with a status code of 2, all other non-zero status codes will cause earth to exit.
For example, if you have:
and my-secret-provider (which is accessible on your PATH):
Then when earth encounters a command that requires a secret, such as
earth will request the secret for mysecret by calling my-secret_provider mysecret.
conversion_parallelism
The number of concurrent converters for speeding up build targets that use blocking commands like IF, WITH DOCKER --load, FROM DOCKERFILE and others.
buildkit_max_parallelism
The maximum parallelism configured for the BuildKit daemon workers. The default is 20.
buildkit_additional_args
This option allows you to pass additional options to Docker when starting up the EarthBuild BuildKit daemon. Note that changes to these values will trigger earth to restart BuildKit on the next run.
Bypass User Namespacing
The --userns flag can be set as follows:
Session Timeout
By default, BuildKit will automatically cancel sessions (i.e. individual builds) after 24 hours. This value can be overridden using the following option:
Note that setting a value of zero 0 here will disable the feature entirely. This can be useful in cases where long-lived interactive sessions are used.
buildkit_additional_config
This option allows you to pass additional options to BuildKit. Note that changes to these values will trigger earth to restart BuildKit on the next run.
Additional CA Certificates
Additional CA certificates can be passed in to BuildKit. This also requires a corresponding change in buildkit_additional_args.
cni_mtu
Allows overriding EarthBuild's automatic MTU detection. This is used when configuring the BuildKit internal CNI network. MTU must be between 64 and 65,536.
ip_tables
Allows overriding EarthBuild's automatic ip_tables module detection. Valid choices are iptables-legacy or iptables-nft.
no_loop_device (obsolete)
This option is obsolete and it is ignored. EarthBuild no longer uses a loop device for its cache.
git_image
Allows to override the image used to run internal git commands (e.g. during GIT CLONE or IMPORT). This defaults to alpine/git:v2.30.1.
Frontend configuration
This option allows you to specify what supported container engine you are using (docker / podman / apple-container). By default, EarthBuild will attempt to automatically discover the container engine in this order: Docker -> Podman -> Apple Container -> None (Stub).
For Docker:
For Podman:
For Apple Container (macOS):
You can use the following command to set the configuration option using the earth CLI:
Git configuration reference
All git configuration is contained under site-specific options.
site-specific options
site
The git repository hostname. For example github.com, or gitlab.com
auth
Either ssh, https, or auto (default). If https is specified, user and password fields are used to authenticate over HTTPS when pulling from git for the corresponding site. If auto is specified earth will use ssh when the ssh-agent is running and has at least one key loaded, and will fallback to using https when no ssh-keys are present.
See the Authentication guide for a guide on setting up authentication.
user
The HTTPS username to use when auth is set to https. This setting is ignored when auth is ssh.
password
The HTTPS password to use when auth is set to https. This setting is ignored when auth is ssh.
strict_host_key_checking
The strict_host_key_checking option 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 false disables host key checking. This setting is only used when auth is ssh.
ssh_command
The ssh_command option can be used to override the ssh command that is used by git when connecting to an ssh-based repository. For example, if you need to connect to an outdated sshd-server which only supports the insecure RSA signature algorithm, you could set the ssh_command to ssh -o 'PubKeyAcceptedKeyTypes +ssh-rsa'.
port
Connect using a non-standard git port, e.g. 2222.
prefix
The prefix option is used to indicate where git repositories are stored on the server, e.g. /var/git/.
pattern
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 github.com/<user>/<repo>.
See the Authentication guide for a guide on setting up authentication with self-hosted git repositories.
See the RE2 docs for a complete definition of the supported regular expression syntax.
substitute
If specified, a regular expression substitution will be performed to determine which URL is cloned by git. Values like $1, $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.
See the Authentication guide for a guide on setting up authentication with self-hosted git repositories.
Last updated