3

When I run podman images, I see a bunch of images like this,

$ podman images
REPOSITORY                 TAG        IMAGE ID      CREATED       SIZE
localhost/tcms             latest     e6d31cbc5385  10 hours ago  86.4 MB
<none>                     <none>     8f773eba96cd  10 hours ago  86.4 MB
<none>                     <none>     3e335f6f49fe  13 hours ago  93.9 MB
<none>                     <none>     6e41c1796a0f  13 hours ago  93.9 MB
<none>                     <none>     bdde160250db  13 hours ago  93.3 MB
<none>                     <none>     d323538cae8f  13 hours ago  93.3 MB

How can I remove those images where the label is <none> en masse? I don't see command that does this under podman images --help

4 Answers 4

5

However insane the design decision

  • podman images
  • podman image

are different commands, you'll want to use

podman image prune

Which will remove unused images with a label of <NONE>. If you add the -a flag it will remove all images, even those with a label, if they're unused by a container.

0

The prune command didn't work for me.

What worked was to delete the 'ghost' images using the Id.

No need to specify the full id, just the first 2 chars are enough

$ podman image ls -a | grep '<none>'

<none> 75108329e92d 10 minutes ago 782 MB

Then the first image can be deleted with:

podman rmi 75

It will be faster to start deleting the first image from top to bottom. Then continue with the remaining images.

1
  • So you have to do this one at a time?    The question asked how to do it en masse. Commented Aug 27, 2024 at 23:20
0

You can use the following command

sudo podman image ls -a | grep '<none>' | awk '{print $3}' | xargs sudo podman rmi -f

to find your images with label \<none>, extract the ID (the awk part) and pass each ID to podman rmi (-f means force).

0

I am late to the party, but here's another way to delete images without tags en masse:

podman rmi $(podman images -f "dangling=true" -q)

You'll get a warning if the images are in use. You can use podman rmi --force, but it's better check them first.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.