LinuxmacOSWindows

Where Is the Earthfile?

Earthly reads Earthfile at the repo root with targets for builds, tests, and image pushes.

Last updated

Earthly configures builds from an Earthfile at the repository root. Targets inside name base images, copy steps, and save directives for artifacts. The build runner executes them in containers for repeatability.

No daemon config matters for daily work. Secrets arrive per run through flags or stores, never committed. Keep the Earthfile beside the Dockerfiles it replaces for clear migration.

Where Earthly stores this, by platform

Linux
[Repo]/Earthfile

Build test and push targets live here. Secrets pass per run through flags. Runner caches under /var/lib/earthly by default.

macOS
[Repo]/Earthfile

Same root file on Mac. Builds run inside the Earthly VM transparently. Volume mounts follow the project root.

Windows
[Repo]\Earthfile

Same file on Windows with WSL backed builds. Line endings inside stay Unix style. Exact syntax versions with the runner.

Frequently asked questions

How do I run one Earthly target?

Name it after the path, like plus signs with the target name. Dependencies build in order automatically. Outputs land where save directives point.

Where does Earthly cache builds?

In the runner volume under /var/lib/earthly on Linux hosts. Prune with the prune command when disks fill. Remote caching shares layers across machines.

Notice an outdated path? Let us know.