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

distrobox-rm: add --image/-i for delete container image #1445

Closed
wants to merge 1 commit into from

Conversation

Boria138
Copy link
Contributor

No description provided.

distrobox-rm Fixed Show fixed Hide fixed
distrobox-rm Fixed Show resolved Hide resolved
distrobox-rm Fixed Show fixed Hide fixed
distrobox-rm Fixed Show fixed Hide fixed
@Boria138 Boria138 force-pushed the distrobox-rm-image branch 6 times, most recently from a96ed21 to 2425c7b Compare June 20, 2024 14:07
distrobox-rm Fixed Show fixed Hide fixed
@89luca89
Copy link
Owner

Thanks @Boria138 for the PR!

One problem with this is that force-deleting an image will remove also other containers using that image, for example:

image

@Boria138
Copy link
Contributor Author

Thanks @Boria138 for the PR!

One problem with this is that force-deleting an image will remove also other containers using that image, for example:

image

Yes, unfortunately, if you delete the image, then all the containers that use it are also deleted, but I think it's not a problem, because if a person decided to delete the image, I think he does not need the containers as well

@Boria138
Copy link
Contributor Author

I think you can change that distrobox rm deletes by image name, not by container name.

distrobox-rm Fixed Show fixed Hide fixed
distrobox-rm Fixed Show fixed Hide fixed
distrobox-rm Fixed Show fixed Hide fixed
distrobox-rm Fixed Show fixed Hide fixed
@Boria138
Copy link
Contributor Author

@89luca89 I rewrote the code so that the image name would be used, but unfortunately --filter only takes one argument at a time

distrobox-rm Fixed Show fixed Hide fixed
distrobox-rm Fixed Show fixed Hide fixed
distrobox-rm Fixed Show fixed Hide fixed
distrobox-rm Fixed Show fixed Hide fixed
distrobox-rm Fixed Show fixed Hide fixed
distrobox-rm Fixed Show fixed Hide fixed
distrobox-rm Fixed Show fixed Hide fixed
@Boria138 Boria138 force-pushed the distrobox-rm-image branch 2 times, most recently from 9998c1c to a2c3ac5 Compare June 20, 2024 16:34
@89luca89
Copy link
Owner

@Boria138 tested the code, and from what I see it now is distrobox rm -i name:tag
but if there is stuff using it, it errors out:

image

What I would do probably is

  • keep the --clean-image flag, for example
  • when rm-ing a container, check if the image is used by other containers
  • if --clean-image AND image is NOT used by other containers, then we prompt (accordingly to -Y or --force) to remove the dangling image

This should make it more intuitive to use and less error prone

what do you think?

@Boria138
Copy link
Contributor Author

@Boria138 tested the code, and from what I see it now is distrobox rm -i name:tag
but if there is stuff using it, it errors out:

image

What I would do probably is

  • keep the --clean-image flag, for example
  • when rm-ing a container, check if the image is used by other containers
  • if --clean-image AND image is NOT used by other containers, then we prompt (accordingly to -Y or --force) to remove the dangling image

This should make it more intuitive to use and less error prone

what do you think?

I like this idea I will soon be implementing it

distrobox-rm Fixed Show fixed Hide fixed
distrobox-rm Fixed Show fixed Hide fixed
distrobox-rm Fixed Show fixed Hide fixed
distrobox-rm Fixed Show fixed Hide fixed
distrobox-rm Fixed Show fixed Hide fixed
distrobox-rm Fixed Show fixed Hide fixed
@Boria138 Boria138 force-pushed the distrobox-rm-image branch 2 times, most recently from b190c53 to a6588f9 Compare July 1, 2024 13:43
@89luca89
Copy link
Owner

@Boria138 I'm closing this as I'm not really convinced about the feature
we can reopen the discussion in a feature request in the future if that's really needed

@89luca89 89luca89 closed this Oct 10, 2024
@Boria138 Boria138 deleted the distrobox-rm-image branch October 12, 2024 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants