1podman-image-prune(1)       General Commands Manual      podman-image-prune(1)
2
3
4

NAME

6       podman-image-prune - Remove all unused images from the local store
7
8

SYNOPSIS

10       podman image prune [options]
11
12

DESCRIPTION

14       podman image prune removes all dangling images from local storage. With
15       the all option, you can delete all unused images (i.e., images  not  in
16       use by any container).
17
18
19       The  image prune command does not prune cache images that only use lay‐
20       ers that are necessary for other images.
21
22

OPTIONS

24   --all, -a
25       Remove dangling images and images that have no associated containers.
26
27
28   --external
29       Remove images even when they are used  by  external  containers  (e.g.,
30       build containers).
31
32
33   --filter=filters
34       Provide filter values.
35
36
37       The  filters argument format is of key=value. If there is more than one
38       filter, then pass multiple OPTIONS: --filter foo=bar --filter bif=baz.
39
40
41       Supported filters:
42
43
44       ┌───────┬────────────────────────────┐
45Filter Description                
46       ├───────┼────────────────────────────┤
47label  │ Only remove  images,  with │
48       │       │ (or  without,  in the case │
49       │       │ of label!=[...]  is  used) │
50       │       │ the specified labels.      │
51       ├───────┼────────────────────────────┤
52until  │ Only remove images created │
53       │       │ before given timestamp.    │
54       └───────┴────────────────────────────┘
55
56       The label filter accepts two formats.  One  is  the  label=key  or  la‐
57       bel=key=value,  which removes containers with the specified labels. The
58       other format is the label!=key or label!=key=value, which removes  con‐
59       tainers without the specified labels.
60
61
62       The  until  filter can be Unix timestamps, date formatted timestamps or
63       Go duration strings (e.g. 10m, 1h30m)  computed  relative  to  the  ma‐
64       chine’s time.
65
66
67   --force, -f
68       Do not provide an interactive prompt for container removal.
69
70
71   --help, -h
72       Print usage statement
73
74

EXAMPLES

76       Remove all dangling images from local storage
77
78
79              $ sudo podman image prune
80
81              WARNING! This will remove all dangling images.
82              Are you sure you want to continue? [y/N] y
83              f3e20dc537fb04cb51672a5cb6fdf2292e61d411315549391a0d1f64e4e3097e
84              324a7a3b2e0135f4226ffdd473e4099fd9e477a74230cdc35de69e84c0f9d907
85
86
87
88       Remove all unused images from local storage without confirming
89
90
91              $ sudo podman image prune -a -f
92              f3e20dc537fb04cb51672a5cb6fdf2292e61d411315549391a0d1f64e4e3097e
93              324a7a3b2e0135f4226ffdd473e4099fd9e477a74230cdc35de69e84c0f9d907
94              6125002719feb1ddf3030acab1df6156da7ce0e78e571e9b6e9c250424d6220c
95              91e732da5657264c6f4641b8d0c4001c218ae6c1adb9dcef33ad00cafd37d8b6
96              e4e5109420323221f170627c138817770fb64832da7d8fe2babd863148287fca
97              77a57fa8285e9656dbb7b23d9efa837a106957409ddd702f995605af27a45ebe
98
99
100
101
102       Remove all unused images from local storage since given time/hours.
103
104
105              $ sudo podman image prune -a --filter until=2019-11-14T06:15:42.937792374Z
106
107              WARNING! This will remove all dangling images.
108              Are you sure you want to continue? [y/N] y
109              e813d2135f17fadeffeea8159a34cfdd4c30b98d8111364b913a91fd930643e9
110              5e6572320437022e2746467ddf5b3561bf06e099e8e6361df27e0b2a7ed0b17b
111              58fda2abf5042b35dfe04e5f8ee458a3cc26375bf309efb42c078b551a2055c7
112              6d2bd30fe924d3414b64bd3920760617e6ced872364bc3bc6959a623252da002
113              33d1c829be64a1e1d379caf4feec1f05a892c3ef7aa82c0be53d3c08a96c59c5
114              f9f0a8a58c9e02a2b3250b88cc5c95b1e10245ca2c4161d19376580aaa90f55c
115              1ef14d5ede80db78978b25ad677fd3e897a578c3af614e1fda608d40c8809707
116              45e1482040e441a521953a6da2eca9bafc769e15667a07c23720d6e0cafc3ab2
117
118              $ sudo podman image prune -f --filter until=10h
119              f3e20dc537fb04cb51672a5cb6fdf2292e61d411315549391a0d1f64e4e3097e
120              324a7a3b2e0135f4226ffdd473e4099fd9e477a74230cdc35de69e84c0f9d907
121
122
123
124       Remove all unused images from local storage with label version 1.0
125
126
127              $ sudo podman image prune -a -f --filter label=version=1.0
128              e813d2135f17fadeffeea8159a34cfdd4c30b98d8111364b913a91fd930643e9
129              5e6572320437022e2746467ddf5b3561bf06e099e8e6361df27e0b2a7ed0b17b
130              58fda2abf5042b35dfe04e5f8ee458a3cc26375bf309efb42c078b551a2055c7
131              6d2bd30fe924d3414b64bd3920760617e6ced872364bc3bc6959a623252da002
132              33d1c829be64a1e1d379caf4feec1f05a892c3ef7aa82c0be53d3c08a96c59c5
133              f9f0a8a58c9e02a2b3250b88cc5c95b1e10245ca2c4161d19376580aaa90f55c
134              1ef14d5ede80db78978b25ad677fd3e897a578c3af614e1fda608d40c8809707
135              45e1482040e441a521953a6da2eca9bafc769e15667a07c23720d6e0cafc3ab2
136
137
138
139

SEE ALSO

141       podman(1), podman-images(1)
142
143

HISTORY

145       December 2018, Originally compiled by Brent Baude (bbaude at redhat dot
146       com) December 2020, converted filter information  from  docs.docker.com
147       documentation by Dan Walsh (dwalsh at redhat dot com)
148
149
150
151                                                         podman-image-prune(1)
Impressum