Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

proposal: cmd: add -a(all) flag to ignite image rm command #869

Open
GrigoriyMikhalkin opened this issue Sep 10, 2021 · 3 comments
Open

Comments

@GrigoriyMikhalkin
Copy link

GrigoriyMikhalkin commented Sep 10, 2021

Currently, to remove all images user needs to specify each image ID or name by hand, which is quite inconvenient. It would be useful to have flag --all(short: -a)) for ignite image rm command, that would allow to remove all existing images.

@stealthybox
Copy link
Contributor

The docker equivalent way to do this is:

docker image rm $(docker image ls -q)

This also works for ignite:

sudo ignite image rm $(sudo ignite image ls -q)

How does that solution look to you?
It's not as simple as a single flag, but it's been that way with docker for a long time.

Another related docker command that we would consider adding would be docker image prune --all

@GrigoriyMikhalkin
Copy link
Author

@stealthybox IMO, it's a little bit complex(i.e. needs memorization). I usually use docker image prune -a command, as you mentioned.

If it's ok, i would like to work on adding ignite image prune command (with --all flag). Question is, would prune command be identical to rm command in context of ignite(besides --all flag)?

@darkowlzz
Copy link
Contributor

Hi @GrigoriyMikhalkin , the prune command in docker is used to remove dangling images by default and -a is a special case. In case of ignite, I don't think we have dangling images. So the behavior of image prune in ignite would likely be to just remove the unused images. I don't think we'd like to implement -a to remove all the image, even the ones in use by VMs.
To get started, I would recommend implementing the prune command to look for images that aren't in use by any VMs and remove those only. That should be the core of the implementation. If we can think of a need for something like -a or --filter, we can add that later.
Also, the OS images and kernel images have similar commands. Once you've the implementation for OS images, we can also add a similar subcommand for kernel images.
You can also join the weaveworks slack to discuss more about it or we can continue discussing more here.

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

No branches or pull requests

3 participants