Skip to content

Commit 4b2c513

Browse files
dvdksnclaude
andcommitted
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 <noreply@anthropic.com>
1 parent 08633c8 commit 4b2c513

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

content/manuals/engine/manage-resources/pruning.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
---
22
description: Free up disk space by removing unused resources with the prune command
3-
keywords: pruning, prune, images, volumes, containers, networks, disk, administration,
3+
keywords:
4+
pruning, prune, images, volumes, containers, networks, disk, administration,
45
garbage collection
56
title: Prune unused Docker objects
67
aliases:
7-
- /engine/admin/pruning/
8-
- /config/pruning/
8+
- /engine/admin/pruning/
9+
- /config/pruning/
910
---
1011

1112
Docker takes a conservative approach to cleaning up unused objects (often
@@ -143,6 +144,35 @@ Other filtering expressions are available. See the
143144
[`docker network prune` reference](/reference/cli/docker/network/prune/)
144145
for more examples.
145146

147+
## Prune build cache
148+
149+
The build cache is used by the BuildKit builder to speed up subsequent builds.
150+
Over time, this cache can grow large. Use `docker builder prune` to remove
151+
dangling build cache — cache that isn't associated with any current build:
152+
153+
```console
154+
$ docker builder prune
155+
156+
WARNING! This will remove all dangling build cache.
157+
Are you sure you want to continue? [y/N] y
158+
```
159+
160+
By default, you're prompted to continue. To bypass the prompt, use the `-f` or
161+
`--force` flag.
162+
163+
To remove all build cache, not just dangling cache, use the `--all` flag:
164+
165+
```console
166+
$ docker builder prune --all
167+
168+
WARNING! This will remove all build cache.
169+
Are you sure you want to continue? [y/N] y
170+
```
171+
172+
Other filtering expressions are available. See the
173+
[`docker builder prune` reference](/reference/cli/docker/builder/prune/)
174+
for more examples.
175+
146176
## Prune everything
147177

148178
The `docker system prune` command is a shortcut that prunes images, containers,

0 commit comments

Comments
 (0)