github.com/containers/podman/v2@v2.2.2-0.20210501105131-c1e07d070c4c/docs/source/markdown/podman-rm.1.md (about)

     1  % podman-rm(1)
     2  
     3  ## NAME
     4  podman\-rm - Remove one or more containers
     5  
     6  ## SYNOPSIS
     7  **podman rm** [*options*] *container*
     8  
     9  **podman container rm** [*options*] *container*
    10  
    11  ## DESCRIPTION
    12  **podman rm** will remove one or more containers from the host.  The container name or ID can be used.  This does not remove images.
    13  Running or unusable containers will not be removed without the **-f** option.
    14  
    15  ## OPTIONS
    16  
    17  #### **--all**, **-a**
    18  
    19  Remove all containers.  Can be used in conjunction with **-f** as well.
    20  
    21  #### **--cidfile**
    22  
    23  Read container ID from the specified file and remove the container.  Can be specified multiple times.
    24  
    25  #### **--force**, **-f**
    26  
    27  Force the removal of running and paused containers. Forcing a container removal also
    28  removes containers from container storage even if the container is not known to podman.
    29  Containers could have been created by a different container engine.
    30  In addition, forcing can be used to remove unusable containers, e.g. containers
    31  whose OCI runtime has become unavailable.
    32  
    33  #### **--ignore**, **-i**
    34  
    35  Ignore errors when specified containers are not in the container store.  A user
    36  might have decided to manually remove a container which would lead to a failure
    37  during the ExecStop directive of a systemd service referencing that container.
    38  
    39  #### **--latest**, **-l**
    40  
    41  Instead of providing the container name or ID, use the last created container. If you use methods other than Podman
    42  to run containers such as CRI-O, the last started container could be from either of those methods.
    43  
    44  The latest option is not supported on the remote client.
    45  
    46  #### **--volumes**, **-v**
    47  
    48  Remove anonymous volumes associated with the container. This does not include named volumes
    49  created with **podman volume create**, or the **--volume** option of **podman run** and **podman create**.
    50  
    51  ## EXAMPLE
    52  Remove a container by its name *mywebserver*
    53  ```
    54  $ podman rm mywebserver
    55  ```
    56  
    57  Remove several containers by name and container id.
    58  ```
    59  $ podman rm mywebserver myflaskserver 860a4b23
    60  ```
    61  
    62  Remove several containers reading their IDs from files.
    63  ```
    64  $ podman rm --cidfile ./cidfile-1 --cidfile /home/user/cidfile-2
    65  ```
    66  
    67  Forcibly remove a container by container ID.
    68  ```
    69  $ podman rm -f 860a4b23
    70  ```
    71  
    72  Remove all containers regardless of its run state.
    73  ```
    74  $ podman rm -f -a
    75  ```
    76  
    77  Forcibly remove the latest container created.
    78  ```
    79  $ podman rm -f --latest
    80  ```
    81  
    82  ## Exit Status
    83    **0**   All specified containers removed
    84  
    85    **1**   One of the specified containers did not exist, and no other failures
    86  
    87    **2**   One of the specified containers is paused or running
    88  
    89    **125** The command fails for any other reason
    90  
    91  ## SEE ALSO
    92  podman(1), podman-image-rm(1), podman-ps(1), podman-build(1), buildah(1), cri-o(1)
    93  
    94  ## HISTORY
    95  August 2017, Originally compiled by Ryan Cole <rycole@redhat.com>