github.com/AliyunContainerService/cli@v0.0.0-20181009023821-814ced4b30d0/docs/reference/commandline/volume_prune.md (about) 1 --- 2 title: "volume prune" 3 description: "Remove unused local volumes" 4 keywords: "volume, prune, delete" 5 --- 6 7 <!-- This file is maintained within the docker/cli GitHub 8 repository at https://github.com/docker/cli/. Make all 9 pull requests against that repo. If you see this file in 10 another repository, consider it read-only there, as it will 11 periodically be overwritten by the definitive file. Pull 12 requests which include edits to this file in other repositories 13 will be rejected. 14 --> 15 16 # volume prune 17 18 ```markdown 19 Usage: docker volume prune [OPTIONS] 20 21 Remove all unused local volumes 22 23 Options: 24 --filter filter Provide filter values (e.g. 'label=<label>') 25 -f, --force Do not prompt for confirmation 26 --help Print usage 27 ``` 28 29 ## Description 30 31 Remove all unused local volumes. Unused local volumes are those which are not referenced by any containers 32 33 ## Examples 34 35 ```bash 36 $ docker volume prune 37 38 WARNING! This will remove all local volumes not used by at least one container. 39 Are you sure you want to continue? [y/N] y 40 Deleted Volumes: 41 07c7bdf3e34ab76d921894c2b834f073721fccfbbcba792aa7648e3a7a664c2e 42 my-named-vol 43 44 Total reclaimed space: 36 B 45 ``` 46 47 ## Filtering 48 49 The filtering flag (`--filter`) format is of "key=value". If there is more 50 than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "bif=baz"`) 51 52 The currently supported filters are: 53 54 * 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. 55 56 The `label` filter accepts two formats. One is the `label=...` (`label=<key>` or `label=<key>=<value>`), 57 which removes volumes with the specified labels. The other 58 format is the `label!=...` (`label!=<key>` or `label!=<key>=<value>`), which removes 59 volumes without the specified labels. 60 61 62 ## Related commands 63 64 * [volume create](volume_create.md) 65 * [volume ls](volume_ls.md) 66 * [volume inspect](volume_inspect.md) 67 * [volume rm](volume_rm.md) 68 * [Understand Data Volumes](https://docs.docker.com/engine/tutorials/dockervolumes/) 69 * [system df](system_df.md) 70 * [container prune](container_prune.md) 71 * [image prune](image_prune.md) 72 * [network prune](network_prune.md) 73 * [system prune](system_prune.md)