jesseduffield / jesseduffield/lazydocker

Changes in default behavior for pruning volumes

Open
#649 1 comment 1 reaction 0 assignees View on GitHub
bug
Dominant language
Go
Stars
52.8k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

The default behavior for pruning Docker volumes by running `docker volume prune` is to only remove anonymous volumes which are not used by at least one container.

In order to also prune named volumes, one has to explicitly use the `-a` (`--a`) option like this `docker volume prune -a`.

Lazydocker seems to be using the latter, more aggressive, option which easily causes data loss since it prunes both anonymous and named volumes.

![Image](https://github.com/user-attachments/assets/aa1f7e04-3d5b-4e1b-9e1e-8004a9e2dd26)

Would it be possible to default volume pruning to work the way how Docker does it by default, where only unused anonymous volumes are removed and maybe add another option which removes both anonymous and named ones?

Something like this:

- prune unused volumes
- prune all unused volumes

The main reason why I am suggesting this is because the ambiguity of the description `prune unused volumes` might lead users to assume that that lazydocker does what Docker does by default, while what's actually going to happen is almost guaranteed to be a data loss due to said ambiguity.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.