podman-container-cleanup(1)
π NAME π
podman-container-cleanup β bestie, this one cleans up a container's network and mountpoints β¨ (yes that's the whole job, and it eats every single time)
πΈ SYNOPSIS πΈ
podman container cleanup [options] container [container ...]
π DESCRIPTION π
okay so real talk, podman container cleanup is the tidy-up queen π. It goes through exited containers and yeets all the mountpoints and network configurations off the host. You can point at a container by its name or its ID, either one, we're flexible like that π
.
π¨ IMPORTANT VIBE CHECK: the cleanup command does not remove the containers. It just does the cleanup. Also, running containers are not cleaned up. Not touching those. They're busy.
So sometimes β and this is the messy part β container mount points and network stacks can just... linger π if the podman command got killed, or if the container ran in daemon mode. Rude. That's exactly the situation this command exists for.
And here's the cute lil fact: this command is automatically executed when containers are run in daemon mode by the conmon process when the container exits. So it's out here doing its job in the background, no cap, no credit, just vibes π¦.
β¨ OPTIONS β¨
--all,-aβ clean up all the containers. Default isfalse. IMPORTANT: this OPTION does not need a container name or ID as an input argument β it's already got the whole roster π«Ά.--exec=sessionβ clean up an exec session for a single container. It can only be specified if a single container is being cleaned up (so yeah, it conflicts with--all, obviously, since that's not a single anything π). If--rmis not specified, temporary files for the exec session get cleaned up; if it is specified, the exec session is removed from the container. IMPORTANT: conflicts with--rmiβ because the container isn't being cleaned up, the image can't be removed. Sorry bestie, that's just the rules π.--latest,-lβ instead of providing the container ID or name, just use the last created container. Default isfalse. IMPORTANT: this OPTION is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines π. This OPTION does not need a container name or ID as input argument.--rmβ after cleanup, remove the container entirely. Default isfalse. gone. poof. β¨--rmiβ after cleanup, remove the image entirely. Default isfalse. the whole fit, deleted π₯
π EXAMPLES π
Clean up the container "mywebserver". iconic behavior:
$ podman container cleanup mywebserver
Clean up the containers with the names "mywebserver", "myflaskserver", "860a4b23" β yes all three at once, multitasking queen:
$ podman container cleanup mywebserver myflaskserver 860a4b23
π SEE ALSO π
podman(1), podman-container(1), conmon(8)
π HISTORY π
Jun 2018 β originally compiled by Dan Walsh dwalsh@redhat.com β¨mailto:dwalsh@redhat.comβ© π
and that's the whole page bestie!! this one's from the podman-container-cleanup(1) manual, mwah π go forth and clean up those mountpoints, i'm obsessed with you π«Άβ¨π
π¦ where this page comes from
- arch rolling: podman-docker 6.1.4-1 Β· Apache-2.0
- fedora 43: podman-docker 5:5.6.2-1.fc43 Β· Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0
- fedora 43: podman-docker 5:5.8.4-1.fc43
- fedora 43: podman-docker 5:5.8.8-1.fc43
- fedora 43: podman-docker 5:5.8.9-1.fc43 Β· Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0
- fedora 44: podman-docker 5:5.8.1-1.fc44 Β· Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0
- fedora 44: podman-docker 5:5.8.7-1.fc44
- fedora 44: podman-docker 5:5.8.9-1.fc44 Β· Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0
- ubuntu resolute: podman-docker 5.7.0+ds2-3build1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms