I'd like to know if there are any difference between using the comand like podman rmi "image_id" or podman rmi "name:tag_version"... When I've committed many versions of images and i want to delete some one I've got differents results about the child dependencies and I don't understand that scenario. If I use name:tag_version delete the image but if I use the image_id it says that exist child dependencies. Why that behaviour?. Thanks
Hello Monomaco,
that's because when you do "docker rmi <name>" you are untagging repository <name> and tag (default to "latest") from an image_id stored in your local cache. If that image_id have no other referencies then the image is deleted too. If other image builds depend on that particular image then the raw image data are not deleted but simply "hidden", you can still view it with "-a" argument to "podman image ls".
I'll show you it with docker but it's the same with podman
Above you see "Untagged"...there's not any "Deleted"
That's because i built another image "FROM alpine"
The image with ID e50c909a8df2 was tagged with "Alpine" and "latest"... trust me...
Then, if you remove the testimg
You notice the 4th Deleted row is the id of the previous "hidden" image, that now is gone with its dependant image
ciao!
Thak you very much for your info
One way to think about image ids versus image name:tag is comparing to Linux filesystems: a file has many names (hard links) but one inode. If you delete a name, you don't delete the file (unless it was the only name). You just don't have an easy command to delete a file by its inode.
Ok, thanks for your comment
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.