|
1 | 1 | --- |
2 | 2 | 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, |
4 | 5 | garbage collection |
5 | 6 | title: Prune unused Docker objects |
6 | 7 | aliases: |
7 | | -- /engine/admin/pruning/ |
8 | | -- /config/pruning/ |
| 8 | + - /engine/admin/pruning/ |
| 9 | + - /config/pruning/ |
9 | 10 | --- |
10 | 11 |
|
11 | 12 | Docker takes a conservative approach to cleaning up unused objects (often |
@@ -143,6 +144,25 @@ Other filtering expressions are available. See the |
143 | 144 | [`docker network prune` reference](/reference/cli/docker/network/prune/) |
144 | 145 | for more examples. |
145 | 146 |
|
| 147 | +## Prune build cache |
| 148 | + |
| 149 | +`docker buildx prune` removes the build cache for the currently selected |
| 150 | +builder. If you use multiple builders, each builder maintains its own cache — |
| 151 | +use the `--builder` flag to target a specific builder instance. |
| 152 | + |
| 153 | +```console |
| 154 | +$ docker buildx 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 | +See the [`docker buildx prune` reference](/reference/cli/docker/buildx/prune/) |
| 164 | +for all options, including `--all` to also remove internal and frontend images. |
| 165 | + |
146 | 166 | ## Prune everything |
147 | 167 |
|
148 | 168 | The `docker system prune` command is a shortcut that prunes images, containers, |
|
0 commit comments