.nh .TH podman-container-cleanup 1 .SH NAME .PP podman-container-cleanup - Clean up the container's network and mountpoints .SH SYNOPSIS .PP \fBpodman container cleanup\fP [\fIoptions\fP] \fIcontainer\fP [\fIcontainer\fP ...] .SH DESCRIPTION .PP \fBpodman container cleanup\fP cleans up exited \fIcontainers\fP by removing all mountpoints and network configuration from the host. The \fIcontainer name\fP or \fIID\fP can be used. The cleanup command does not remove the \fIcontainers\fP\&. Running \fIcontainers\fP will not be cleaned up. .br Sometimes container mount points and network stacks can remain if the podman command was killed or the \fIcontainer\fP ran in daemon mode. This command is automatically executed when \fIcontainers\fP are run in daemon mode by the \fB\fCconmon process\fR when the \fIcontainer\fP exits. .SH OPTIONS .SS \fB--all\fP, \fB-a\fP .PP Clean up all \fIcontainers\fP\&. .br The default is \fBfalse\fP\&. .br \fIIMPORTANT: This OPTION does not need a container name or ID as input argument.\fP .SS \fB--exec\fP=\fIsession\fP .PP Clean up an exec session for a single \fIcontainer\fP\&. Can only be specified if a single \fIcontainer\fP is being cleaned up (conflicts with \fB--all\fP as such). If \fB--rm\fP is not specified, temporary files for the exec session will be cleaned up; if it is, the exec session will be removed from the \fIcontainer\fP\&. .br *IMPORTANT: Conflicts with \fB--rmi\fP as the container is not being cleaned up so the image cannot be removed.* .SS \fB--latest\fP, \fB-l\fP .PP Instead of providing the \fIcontainer ID\fP or \fIname\fP, use the last created \fIcontainer\fP\&. If other methods than Podman are used to run \fIcontainers\fP such as \fB\fCCRI-O\fR, the last started \fIcontainer\fP could be from either of those methods. .br The default is \fBfalse\fP\&. .br \fIIMPORTANT: 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.\fP .SS \fB--rm\fP .PP After cleanup, remove the \fIcontainer\fP entirely. .br The default is \fBfalse\fP\&. .SS \fB--rmi\fP .PP After cleanup, remove the image entirely. .br The default is \fBfalse\fP\&. .SH EXAMPLES .PP Clean up the container "mywebserver". .PP .RS .nf $ podman container cleanup mywebserver .fi .RE .PP Clean up the containers with the names "mywebserver", "myflaskserver", "860a4b23". .PP .RS .nf $ podman container cleanup mywebserver myflaskserver 860a4b23 .fi .RE .SH SEE ALSO .PP \fBpodman(1)\fP, \fBpodman-container(1)\fP, \fBconmon(8)\fP .SH HISTORY .PP Jun 2018, Originally compiled by Dan Walsh dwalsh@redhat.com \[la]mailto:dwalsh@redhat.com\[ra]