github.com/thajeztah/cli@v0.0.0-20240223162942-dc6bfac81a8b/docs/reference/commandline/volume_prune.md (about) 1 # volume prune 2 3 <!---MARKER_GEN_START--> 4 Remove unused local volumes 5 6 ### Options 7 8 | Name | Type | Default | Description | 9 |:------------------------------|:---------|:--------|:---------------------------------------------------| 10 | [`-a`](#all), [`--all`](#all) | | | Remove all unused volumes, not just anonymous ones | 11 | [`--filter`](#filter) | `filter` | | Provide filter values (e.g. `label=<label>`) | 12 | `-f`, `--force` | | | Do not prompt for confirmation | 13 14 15 <!---MARKER_GEN_END--> 16 17 ## Description 18 19 Remove all unused local volumes. Unused local volumes are those which are not 20 referenced by any containers. By default, it only removes anonymous volumes. 21 22 ## Examples 23 24 ```console 25 $ docker volume prune 26 27 WARNING! This will remove anonymous local volumes not used by at least one container. 28 Are you sure you want to continue? [y/N] y 29 Deleted Volumes: 30 07c7bdf3e34ab76d921894c2b834f073721fccfbbcba792aa7648e3a7a664c2e 31 my-named-vol 32 33 Total reclaimed space: 36 B 34 ``` 35 36 ### <a name="all"></a> Filtering (--all, -a) 37 38 Use the `--all` flag to prune both unused anonymous and named volumes. 39 40 ### <a name="filter"></a> Filtering (--filter) 41 42 The filtering flag (`--filter`) format is of "key=value". If there is more 43 than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`) 44 45 The currently supported filters are: 46 47 * label (`label=<key>`, `label=<key>=<value>`, `label!=<key>`, or `label!=<key>=<value>`) - only remove volumes with (or without, in case `label!=...` is used) the specified labels. 48 49 The `label` filter accepts two formats. One is the `label=...` (`label=<key>` or `label=<key>=<value>`), 50 which removes volumes with the specified labels. The other 51 format is the `label!=...` (`label!=<key>` or `label!=<key>=<value>`), which removes 52 volumes without the specified labels. 53 54 ## Related commands 55 56 * [volume create](volume_create.md) 57 * [volume ls](volume_ls.md) 58 * [volume inspect](volume_inspect.md) 59 * [volume rm](volume_rm.md) 60 * [Understand Data Volumes](https://docs.docker.com/storage/volumes/) 61 * [system df](system_df.md) 62 * [container prune](container_prune.md) 63 * [image prune](image_prune.md) 64 * [network prune](network_prune.md) 65 * [system prune](system_prune.md)