Comment on page
This page describes how to manage the Earthly cache locally or on a remote runner, such as an Earthly Satellite.
Earthly cache is persisted in a docker (or podman) volume called
earthly-cacheon your system. When Earthly starts for the first time, it brings up a BuildKit daemon in a Docker container, which initializes the
earthly-cachevolume. The volume is managed by Earthly's BuildKit daemon and there is a regular garbage-collection for old cache.
The default cache size is adaptable depending on available space on your system. It defaults to 10% or 10 GB, whichever is greater. If you would like to change the cache size, you can specify a different limit by modifying the
cache_size_pctsettings in the configuration. For example:
Checking current size of the cache volume
You can check the current size of the cache volume by running:
sudo du -h /var/lib/docker/volumes/earthly-cache | tail -n 1
To reset the cache, you can issue the command
You can also safely delete the cache manually, if the daemon is not running
docker stop earthly-buildkitd
docker rm earthly-buildkitd
docker volume rm earthly-cache
Earthly also has a command that automates the above:
earthly prune --reset
earthly prunewill work on remote runners too, albeit without the
--resetflag, which is not supported in a remote setting.
To cause a satellite to restart with a fresh cache, you can use the command
earthly sat update --drop-cache.