image prune: remove unused images only with --all

Fix a regression in `podman image prune` where unused images were
accidentally removed even when `--all=false`.  Extend and partially
rewrite the e2e tests to make sure we're not regressing again in the
future.

Fixing the aforementioned issue revealed another issue in the default
prune filter.  While prune should remove all "dangling" images (i.e.,
those without tag), it removed only "intermediate" ones; dangling images
without children.  Remove the mistaken comment from the libimage
migration.

Also clarify the help message and man page.

Fixes: #10350
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
Valentin Rothberg
2021-05-17 11:38:28 +02:00
parent 3bdbe3ce96
commit 2a43fcf786
4 changed files with 58 additions and 30 deletions

View File

@ -8,8 +8,7 @@ podman-image-prune - Remove all unused images from the local store
## DESCRIPTION
**podman image prune** removes all dangling images from local storage. With the `all` option,
you can delete all unused images. Unused images are dangling images as well as any image that
does not have any containers based on it.
you can delete all unused images (i.e., images not in use by any container).
The image prune command does not prune cache images that only use layers that are necessary for other images.