From 4b2c513afc6b61d0209d96bca036ff7c603fd8cf Mon Sep 17 00:00:00 2001 From: David Karlsson <35727626+dvdksn@users.noreply.github.com> Date: Thu, 19 Mar 2026 17:03:40 +0100 Subject: [PATCH] docs: add docker builder prune to pruning page Fixes #17590. Adds a new "Prune build cache" section covering docker builder prune, including the --all flag for removing all build cache (not just dangling entries). Co-Authored-By: Claude Sonnet 4.6 --- .../engine/manage-resources/pruning.md | 36 +++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/content/manuals/engine/manage-resources/pruning.md b/content/manuals/engine/manage-resources/pruning.md index 630db86d3223..8233dd1d052c 100644 --- a/content/manuals/engine/manage-resources/pruning.md +++ b/content/manuals/engine/manage-resources/pruning.md @@ -1,11 +1,12 @@ --- description: Free up disk space by removing unused resources with the prune command -keywords: pruning, prune, images, volumes, containers, networks, disk, administration, +keywords: + pruning, prune, images, volumes, containers, networks, disk, administration, garbage collection title: Prune unused Docker objects aliases: -- /engine/admin/pruning/ -- /config/pruning/ + - /engine/admin/pruning/ + - /config/pruning/ --- Docker takes a conservative approach to cleaning up unused objects (often @@ -143,6 +144,35 @@ Other filtering expressions are available. See the [`docker network prune` reference](/reference/cli/docker/network/prune/) for more examples. +## Prune build cache + +The build cache is used by the BuildKit builder to speed up subsequent builds. +Over time, this cache can grow large. Use `docker builder prune` to remove +dangling build cache — cache that isn't associated with any current build: + +```console +$ docker builder prune + +WARNING! This will remove all dangling build cache. +Are you sure you want to continue? [y/N] y +``` + +By default, you're prompted to continue. To bypass the prompt, use the `-f` or +`--force` flag. + +To remove all build cache, not just dangling cache, use the `--all` flag: + +```console +$ docker builder prune --all + +WARNING! This will remove all build cache. +Are you sure you want to continue? [y/N] y +``` + +Other filtering expressions are available. See the +[`docker builder prune` reference](/reference/cli/docker/builder/prune/) +for more examples. + ## Prune everything The `docker system prune` command is a shortcut that prunes images, containers,