On a server running containers with Podman I just realised, there are many containers with "Exited" status and wanted to remove all of them in one go.
How can I do it with Podman?
On a server running containers with Podman I just realised, there are many containers with "Exited" status and wanted to remove all of them in one go.
How can I do it with Podman?
After searching for some time I found a quick and easy one liner to get my exited containers cleaned.
One option is:
podman rm -f $(podman ps -a -f "status=exited" -q)
The second option is:
podman ps -f status=exited --format "{{.ID}}" | xargs podman rm -f
A big thanks to dannotdaniel for the second option. This saved me at least an hour. :)
According to the official documentation there is a specific command for just that purpose:
Remove all stopped containers from local storage:
podman container prune
After searching for some time I found a quick and easy one liner to get my exited containers cleaned.
One option is:
podman rm -f $(podman ps -a -f "status=exited" -q)
The second option is:
podman ps -f status=exited --format "{{.ID}}" | xargs podman rm -f
A big thanks to dannotdaniel for the second option. This saved me at least an hour. :)
© 2022 - 2024 — McMap. All rights reserved.