Open Boria138 opened 2 weeks ago
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:
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
I think you can change that distrobox rm deletes by image name, not by container name.
@89luca89 I rewrote the code so that the image name would be used, but unfortunately --filter only takes one argument at a time
@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:
What I would do probably is
--clean-image
flag, for example--clean-image
AND image is NOT used by other containers, then we prompt (accordingly to -Y or --force) to remove the dangling imageThis should make it more intuitive to use and less error prone
what do you think?
@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:
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 imageThis 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
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: