1podman-rm(1)()                                                  podman-rm(1)()
2
3
4

NAME

6       podman-rm - Remove one or more containers
7
8

SYNOPSIS

10       podman rm [options] container
11
12
13       podman container rm [options] container
14
15

DESCRIPTION

17       podman  rm  will remove one or more containers from the host.  The con‐
18       tainer name or ID can be used.  This does not remove  images.   Running
19       or unusable containers will not be removed without the -f option.
20
21

OPTIONS

23       --all, -a
24
25
26       Remove all containers.  Can be used in conjunction with -f as well.
27
28
29       --cidfile
30
31
32       Read  container  ID  from  the specified file and remove the container.
33       Can be specified multiple times.
34
35
36       --force, -f
37
38
39       Force the removal of running and paused containers. Forcing a container
40       removal also removes containers from container storage even if the con‐
41       tainer is not known to podman.  Containers could have been created by a
42       different container engine.  In addition, forcing can be used to remove
43       unusable containers, e.g.  containers  whose  OCI  runtime  has  become
44       unavailable.
45
46
47       --ignore, -i
48
49
50       Ignore errors when specified containers are not in the container store.
51       A user might have decided to manually remove a  container  which  would
52       lead  to  a  failure during the ExecStop directive of a systemd service
53       referencing that container.
54
55
56       --latest, -l
57
58
59       Instead of providing the container name or ID,  use  the  last  created
60       container.  If you use methods other than Podman to run containers such
61       as CRI-O, the last started container could  be  from  either  of  those
62       methods.
63
64
65       The latest option is not supported on the remote client.
66
67
68       --storage
69
70
71       Remove  the container from the storage library only.  This is only pos‐
72       sible with containers that are not present in libpod (cannot be seen by
73       podman  ps).   It  is  used  to remove containers from podman build and
74       buildah, and orphan containers which were  only  partially  removed  by
75       podman  rm.  The storage option conflicts with the --all, --latest, and
76       --volumes options.
77
78
79       --volumes, -v
80
81
82       Remove anonymous volumes associated with the container. This  does  not
83       include  named volumes created with podman volume create, or the --vol‐
84       ume option of podman run and podman create.
85
86

EXAMPLE

88       Remove a container by its name mywebserver
89
90
91              $ podman rm mywebserver
92
93
94
95       Remove several containers by name and container id.
96
97
98              $ podman rm mywebserver myflaskserver 860a4b23
99
100
101
102       Remove several containers reading their IDs from files.
103
104
105              $ podman rm --cidfile ./cidfile-1 --cidfile /home/user/cidfile-2
106
107
108
109       Forcibly remove a container by container ID.
110
111
112              $ podman rm -f 860a4b23
113
114
115
116       Remove all containers regardless of its run state.
117
118
119              $ podman rm -f -a
120
121
122
123       Forcibly remove the latest container created.
124
125
126              $ podman rm -f --latest
127
128
129

Exit Status

131       0   All specified containers removed
132
133
134       1   One of the specified containers did not exist, and no  other  fail‐
135       ures
136
137
138       2   One of the specified containers is paused or running
139
140
141       125  The  command fails for a reason other than container did not exist
142       or is paused/running
143
144

SEE ALSO

146       podman(1), podman-image-rm(1)
147
148

HISTORY

150       August  2017,  Originally  compiled  by  Ryan  Cole   rycole@redhat.com
151       ⟨mailto:rycole@redhat.com⟩
152
153
154
155                                                                podman-rm(1)()
Impressum