docker-buildx-prune
Remove Docker Buildx build cache
TLDR
SYNOPSIS
docker buildx prune [options]
DESCRIPTION
docker buildx prune clears the build cache of the currently selected builder instance. By default it removes only reclaimable cache entries, prompting for confirmation. With --all, it also removes internal and frontend images.The space management flags (--max-used-space, --min-free-space, --reserved-space) allow fine-grained control over disk usage. The --filter flag supports selectors like until, id, type, inuse, mutable, shared, and private, combined with AND logic.
PARAMETERS
-a, --all
Remove all cache including internal and frontend images.-f, --force
Skip the confirmation prompt.--filter key=value
Filter cache records to prune (e.g., until=24h, type, inuse, shared).--max-used-space size
Maximum total disk space for the cache (e.g., 2gb, 512mb).--min-free-space size
Target amount of free disk space after pruning.--reserved-space size
Minimum disk space permanently reserved for cache.--timeout duration
Override default timeout for loading builder status (default: 20s).--verbose
Show detailed output.
CAVEATS
Without --all, internal images and frontend cache are preserved. Space flags accept human-readable values (e.g., 128mb, 2gb). When multiple space flags are specified, all constraints are honored simultaneously.
SEE ALSO
docker-buildx-du(1), docker-buildx-rm(1), docker-build(1), docker(1)
