1podman-container-prune(1) General Commands Manual podman-container-prune(1)
2
3
4
6 podman-container-prune - Remove all stopped containers from local stor‐
7 age
8
9
11 podman container prune [options]
12
13
15 podman container prune removes all stopped containers from local stor‐
16 age.
17
18
20 --filter=filters
21 Provide filter values.
22
23
24 The filters argument format is of key=value. If there is more than one
25 filter, then pass multiple OPTIONS: --filter foo=bar --filter bif=baz.
26
27
28 Supported filters:
29
30
31 ┌───────┬────────────────────────────┐
32 │Filter │ Description │
33 ├───────┼────────────────────────────┤
34 │label │ Only remove containers, │
35 │ │ with (or without, in the │
36 │ │ case of label!=[...] is │
37 │ │ used) the specified la‐ │
38 │ │ bels. │
39 ├───────┼────────────────────────────┤
40 │until │ Only remove containers │
41 │ │ created before given time‐ │
42 │ │ stamp. │
43 └───────┴────────────────────────────┘
44
45 The label filter accepts two formats. One is the label=key or la‐
46 bel=key=value, which removes containers with the specified labels. The
47 other format is the label!=key or label!=key=value, which removes con‐
48 tainers without the specified labels.
49
50
51 The until filter can be Unix timestamps, date formatted timestamps, or
52 Go duration strings (e.g. 10m, 1h30m) computed relative to the ma‐
53 chine’s time.
54
55
56 --force, -f
57 Do not provide an interactive prompt for container removal.
58 The default is false.
59
60
61 -h, --help
62
63
64 Print usage statement.
65 The default is false.
66
67
69 Remove all stopped containers from local storage
70
71 $ podman container prune
72 WARNING! This will remove all stopped containers.
73 Are you sure you want to continue? [y/N] y
74 878392adf2e6c5c9bb1fc19b69d37d2e98c8abf9d539c0bce4b15b46bbcce471
75 37664467fbe3618bf9479c34393ac29c02696675addf1750f9e346581636cde7
76 ed0c6468b8e1cb641b4621d1fe30cb477e1fefc5c0bceb66feaf2f7cb50e5962
77 6ac6c8f0067b7a4682e6b8e18902665b57d1a0e07e885d9abcd382232a543ccd
78 fff1c5b6c3631746055ec40598ce8ecaa4b82aef122f9e3a85b03b55c0d06c23
79 602d343cd47e7cb3dfc808282a9900a3e4555747787ec6723bb68cedab8384d5
80
81
82
83 Remove all stopped containers from local storage without confirmation.
84
85 $ podman container prune -f
86 878392adf2e6c5c9bb1fc19b69d37d2e98c8abf9d539c0bce4b15b46bbcce471
87 37664467fbe3618bf9479c34393ac29c02696675addf1750f9e346581636cde7
88 ed0c6468b8e1cb641b4621d1fe30cb477e1fefc5c0bceb66feaf2f7cb50e5962
89 6ac6c8f0067b7a4682e6b8e18902665b57d1a0e07e885d9abcd382232a543ccd
90 fff1c5b6c3631746055ec40598ce8ecaa4b82aef122f9e3a85b03b55c0d06c23
91 602d343cd47e7cb3dfc808282a9900a3e4555747787ec6723bb68cedab8384d5
92
93
94
95 Remove all stopped containers from local storage created before the
96 last 10 minutes
97
98 $ podman container prune --filter until="10m"
99 WARNING! This will remove all stopped containers.
100 Are you sure you want to continue? [y/N] y
101 3d366295e33d8cc612c4d873199bacadd55088d90d17dcafaa9a2d317ad50b4e
102
103
104
106 podman(1), podman-ps(1)
107
108
110 December 2018, Originally compiled by Brent Baude bbaude@redhat.com
111 ⟨mailto:bbaude@redhat.com⟩
112 December 2020, converted filter information from docs.docker.com docu‐
113 mentation by Dan Walsh dwalsh@redhat.com ⟨mailto:dwalsh@redhat.com⟩
114
115
116
117 podman-container-prune(1)