Monomaco
Mission Specialist
Mission Specialist
  • 295 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
  • 248 Views

Re: Question aboutd podman rmi behaviour

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
Reply
Loading...
Monomaco
Mission Specialist
Mission Specialist
  • 241 Views

Re: Question aboutd podman rmi behaviour

Thak you very much for your info

0 Kudos
Reply
Loading...
flozano
Moderator
Moderator
  • 198 Views

Re: Question aboutd podman rmi behaviour

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
Reply
Loading...
Monomaco
Mission Specialist
Mission Specialist
  • 190 Views

Re: Question aboutd podman rmi behaviour

Ok, thanks for your comment

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