cancel
Showing results for 
Search instead for 
Did you mean: 
Monomaco
Mission Specialist
Mission Specialist
  • 1,784 Views

Question aboutd podman rmi behaviour

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

Labels (3)
0 Kudos
4 Replies
matteoclc
Flight Engineer
Flight Engineer
  • 1,737 Views

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

Screenshot_20210201_114934.png

Above you see "Untagged"...there's not any "Deleted"

That's because i built another image "FROM alpine"

Screenshot_20210201_115333.png

Screenshot_20210201_115548.png

The image with ID e50c909a8df2 was tagged with "Alpine" and "latest"... trust me... 

Then, if you remove the testimg

Screenshot_20210201_120657.png

Screenshot_20210201_120737.png

You notice the 4th Deleted row is the id of the previous "hidden" image, that now is gone with its dependant image

ciao!

 

 

--
Matteo Calcagnini
Monomaco
Mission Specialist
Mission Specialist
  • 1,730 Views

Thak you very much for your info

0 Kudos
flozano
Moderator
Moderator
  • 1,687 Views

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.

0 Kudos
Monomaco
Mission Specialist
Mission Specialist
  • 1,679 Views

Ok, thanks for your comment

0 Kudos
Join the discussion
You must log in to join this conversation.