container: make 'container remove' cli command slightly more useful

Usually, when your system is up and running properly, you want to clean
up anything unused from your previous experiments.  This change alllows
that by calling the interactive 'podman image prune -a -f' command from
the CLI command 'container remove all'

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2025-10-23 15:23:54 +02:00
parent 5b7325261a
commit 7fbc2eba4f
2 changed files with 17 additions and 5 deletions
+7 -2
View File
@@ -102,9 +102,14 @@
</COMMAND>
<COMMAND name="remove" help="Remove a container image from local storage">
<PARAM name="name" ptype="/IMAGES" help="Image name" />
<SWITCH name="optional" min="0">
<PARAM name="name" ptype="/IMAGES" help="Image name" />
</SWITCH>
<ACTION sym="script" in="tty" out="tty" interrupt="true">
doas container remove $KLISH_PARAM_name
if [ -n "$KLISH_PARAM_name" ]; then
all=-a
fi
doas container $all remove $KLISH_PARAM_name
</ACTION>
</COMMAND>