github.com/hanks177/podman/v4@v4.1.3-0.20220613032544-16d90015bc83/docs/source/markdown/podman-container-cleanup.1.md (about)

     1  % podman-container-cleanup(1)
     2  
     3  ## NAME
     4  podman\-container\-cleanup - Cleanup the container's network and mountpoints
     5  
     6  ## SYNOPSIS
     7  **podman container cleanup** [*options*] *container* [*container* ...]
     8  
     9  ## DESCRIPTION
    10  **podman container cleanup** cleans up exited *containers* by removing all mountpoints and network configuration from the host. The *container name* or *ID* can be used. The cleanup command does not remove the *containers*. Running *containers* will not be cleaned up.\
    11  Sometimes container mount points and network stacks can remain if the podman command was killed or the *container* ran in daemon mode. This command is automatically executed when *containers* are run in daemon mode by the `conmon process` when the *container* exits.
    12  
    13  ## OPTIONS
    14  #### **--all**, **-a**
    15  
    16  Cleanup all *containers*.\
    17  The default is **false**.\
    18  *IMPORTANT: This OPTION does not need a container name or ID as input argument.*
    19  
    20  #### **--exec**=*session*
    21  
    22  Clean up an exec session for a single *container*.
    23  Can only be specified if a single *container* is being cleaned up (conflicts with **--all** as such). If **--rm** is not specified, temporary files for the exec session will be cleaned up; if it is, the exec session will be removed from the *container*.\
    24  *IMPORTANT: Conflicts with **--rmi** as the container is not being cleaned up so the image cannot be removed.*
    25  
    26  #### **--latest**, **-l**
    27  
    28  Instead of providing the *container ID* or *name*, use the last created *container*. If other methods than Podman are used to run *containers* such as `CRI-O`, the last started *container* could be from either of those methods.\
    29  The default is **false**.\
    30  *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.*
    31  
    32  #### **--rm**
    33  
    34  After cleanup, remove the *container* entirely.\
    35  The default is **false**.
    36  
    37  #### **--rmi**
    38  
    39  After cleanup, remove the image entirely.\
    40  The default is **false**.
    41  
    42  ## EXAMPLES
    43  Cleanup the container "mywebserver".
    44  ```
    45  $ podman container cleanup mywebserver
    46  ```
    47  
    48  Cleanup the containers with the names "mywebserver", "myflaskserver", "860a4b23".
    49  ```
    50  $ podman container cleanup mywebserver myflaskserver 860a4b23
    51  ```
    52  
    53  ## SEE ALSO
    54  **[podman(1)](podman.1.md)**, **[podman-container(1)](podman-container.1.md)**, **[conmon(8)](https://github.com/containers/conmon/blob/main/docs/conmon.8.md)**
    55  
    56  ## HISTORY
    57  Jun 2018, Originally compiled by Dan Walsh <dwalsh@redhat.com>