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

Don't prune volumes on docker system prune #118

Merged
merged 1 commit into from
May 30, 2017

Conversation

cpuguy83
Copy link
Collaborator

Volumes tend to carry important data and pruning them on docker system prune can easily cause unwanted data loss.

Let's play it safe and not prune volumes on system prune.

Throwing this out there.

@mlaventure
Copy link
Contributor

Maybe make it an option? I mean system prune or any other destructive operation are not to be used if you don't know what you're doing 👼

@dnephin
Copy link
Contributor

dnephin commented May 23, 2017

Making it an option sounds good. docker-compose down has a -v option for removing volumes. The default is to only remove containers and networks.

@albers
Copy link
Collaborator

albers commented May 23, 2017

+1 for an option.

@thaJeztah
Copy link
Member

Yes, I think having an option could make sense, on the other hand, calling docker volume prune to cleanup volumes is extra explicit, so may work as well.

Open to both options 😊

@cpuguy83
Copy link
Collaborator Author

We can add an option. THe reason I didn't is it's kind of weird with the existing "--all" option (which is just weird anyway).

Volumes tend to carry important data and pruning them on `docker system
prune` can easily cause unwanted data loss.

Let's play it safe and not prune volumes on `system prune` by default,
and instead provide an option.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
@cpuguy83
Copy link
Collaborator Author

Added the option.

Copy link
Collaborator

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🐯
the --all option is a little bit weird. Could we (in a follow-up PR) deprecated it, hide it and renaming it to --all-images or something ? 👼

Copy link
Contributor

@mlaventure mlaventure left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@mlaventure mlaventure merged commit f3cb13c into docker:master May 30, 2017
@GordonTheTurtle GordonTheTurtle added this to the 17.06.0 milestone May 30, 2017
@cpuguy83 cpuguy83 deleted the no_prune_volume branch May 30, 2017 17:21
@thaJeztah thaJeztah modified the milestones: 17.07.0, 17.06.0 Jun 30, 2017
@thaJeztah
Copy link
Member

This didn't make it into 17.06, so updated the milestone

trapier pushed a commit to trapier/cli that referenced this pull request Sep 30, 2019
…-master-f40f9c240ab03d20ae16ba97ec97ecb2cad50558

[master] sync to upstream master f40f9c2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants