Builtin args
Builtin args are variables with values automatically filled-in by Earthly.
The value of a builtin arg can never be overridden. However, you can always have an additional ARG
, which takes as the default value, the value of the builtin arg. The additional arg can be overridden. Example
Important
In contrast to Dockerfile predefined args, Earthly builtin args need to be pre-declared before they can be used. For example
The following builtin args are available
Name | Description | Example value |
---|---|---|
| The canonical reference of the current target. | For example, for a target named |
| The project part of the canonical reference of the current target. | For the example above, the canonical project would be |
| The project part of the canonical reference of the current target, but without the tag. | For the example above, this would be |
| The name part of the canonical reference of the current target. | For the example above, the name would be |
| The tag part of the canonical reference of the current target. Note that if the target has no canonical form, the value is an empty string. | For the example above, the tag would be |
| The tag part of the canonical reference of the current target, sanitized for safe use as a docker tag. This is guaranteed to be a valid docker tag, even if no canonical form exists, in which case, | For the example above, the docker tag would be |
| The git hash detected within the build context directory. If no git directory is detected, then the value is an empty string. Take care when using this arg, as the frequently changing git hash may be cause for not using the cache. |
|
| The first 8 characters of the git hash detected within the build context directory. If no git directory is detected, then the value is an empty string. Take care when using this arg, as the frequently changing git hash may be cause for not using the cache. |
|
| The git URL detected within the build context directory. If no git directory is detected, then the value is an empty string. Please note that this may be inconsistent, depending on whether an HTTPS or SSH URL was used. |
|
| The git project name from within the git URL detected within the build context directory. If no git directory is detected, then the value is an empty string. |
|
| The committer timestamp, as unix seconds, of the git commit detected within the build context directory. If no git directory is detected, then the value is an empty string. |
|
| The author timestamp, as unix seconds, of the git commit detected within the build context directory. If no git directory is detected, then the value is an empty string. |
|
| The version of Earthly currently running. |
|
| The git hash of the commit which built the currently running version of Earthly. |
|
| The target platform the target is being built for. |
|
| The target OS the target is being built for. |
|
| The target processor architecture the target is being built for. |
|
| The target processor architecture variant the target is being built for. |
|
| The timestamp, as unix seconds, of the git commit detected within the build context directory. If no git directory is detected, then the value is |
|
| The platform the target is being built from. |
|
| The OS the target is being built from. |
|
| The processor architecture the target is being built from. |
|
| The processor architecture variant the target is being built from. |
|
requires use of feature-flag, for example:
VERSION --earthly-version-arg 0.6
.
Note
The classical Dockerfile predefined args are currently not available in Earthly.
Last updated