Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to create Volume Groups for managing multiple related volumes. #5119

Open
KariNarhi opened this issue Jun 4, 2024 · 0 comments
Open

Comments

@KariNarhi
Copy link

Description

Reason / Backstory for the feature idea:

On my Mac, I have installed the local version of Supabase, which uses Docker to run the development environment containers and those containers have some automatically created volumes attached to them.

Once I was cleaning out the junk containers, images and the volumes that had been accumulating over time.

When I was about to remove unused volumes with docker volume prune ( since there were so many of them ), I realized that the Supabase-related volumes would be gone too since I am not running the Supabase local version all the time, meaning they also would be "unused", so I avoided potentially breaking the Supabase environment.

After that, I thought to myself:
I'd be great if I could somehow manage these in related batches/groups.

Feature Idea (pseudo-code):

Create volume group
docker volume group create <group_name> [existing_volume_name]

Groups could be created initially empty or provided with existing volumes that don't belong to a group already.

Add volume to a group
docker volume group add <group_name> <volume_name>

Remove volume from a group
docker volume group remove <group_name> <volume_name>

When adding or removing volumes, the volumes should not be in use.

Rename volume group
docker volume group rename <current_group_name> <new_group_name>

Should be self-explanatory, sometimes we make typos or want to give more descriptive name.

List volume groups
docker volume group ls

Also self-explanatory, list the existing groups.

Delete volume group
docker volume group delete <group_name>

Deleting group would delete all the volumes that belong to it.

Could have an option to delete group, but retain the volumes in default volume directory.

Prune volume group
docker volume group prune <group_name>

Delete all unused volumes from a group.

This is the main reason I came up with this idea. By having important volumes, for example, the Supabase-related volumes under e.g "supabase" group and my tinkering-related volumes under e.g "misc", "temp" or similar, I could've easily removed all the non-important volumes at once, instead of one at a time or stacking them with docker volume rm.

In a nutshell:

Instead of having all the volumes listed on one level with same docker volume execution context, we could have them organized into groups in which they share same context and thus provide more granular control and prevent accidentally removing e.g production volumes when deleting multiple volumes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants