[22.06 backport] Volume prune: only prune anonymous volumes by default#44259
Conversation
This adds a new filter argument to the volume prune endpoint "all". When this is not set, or it is a false-y value, then only anonymous volumes are considered for pruning. When `all` is set to a truth-y value, you get the old behavior. This is an API change, but I think one that is what most people would want. Signed-off-by: Brian Goff <cpuguy83@gmail.com> Signed-off-by: Sebastiaan van Stijn <github@gone.nl> (cherry picked from commit 618f26c) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
|
So what's the behaviour of |
|
It seems like this was included in Docker 23 and broke |
|
Is there backwards compatible syntax that can be used to prune volumes across versions (keeping the old behavior)? We have many docker nodes deployed, which often have a mix of different CLI versions (upgrades are not always feasible immediately for a variety of reasons I won't get into, including disparate OS). Introducing this change not only breaks existing scripts we have to prune data volumes, but is also non-backwards-compatible such that any nodes running slightly out-of-date daemons fail hard with Any suggestions on how to prune all volumes with the same command both before and after this change would be great. |
"docker system prune --volumes" does no longer prune named volumes in Docker 23.0[1][2], so use "docker volume prune --all"[3] for pruning named volumes. [1] docker/cli#4028 [2] moby/moby#44259 [3] docker/cli#4229
This adds a new filter argument to the volume prune endpoint "all". When this is not set, or it is a false-y value, then only anonymous volumes are considered for pruning.
When
allis set to a truth-y value, you get the old behavior.This is an API change, but I think one that is what most people would want.
(cherry picked from commit 618f26c)
- What I did
- How I did it
- How to verify it
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)