1podman-system-prune(1) General Commands Manual podman-system-prune(1)
2
3
4
6 podman-system-prune - Remove all unused pods, containers, images, net‐
7 works, and volume data
8
9
11 podman system prune [options]
12
13
15 podman system prune removes all unused containers (both dangling and
16 unreferenced), pods, networks, and optionally, volumes from local stor‐
17 age.
18
19
20 Use the --all option to delete all unused images. Unused images are
21 dangling images as well as any image that does not have any containers
22 based on it.
23
24
25 By default, volumes are not removed to prevent important data from be‐
26 ing deleted if there is currently no container using the volume. Use
27 the --volumes flag when running the command to prune volumes as well.
28
29
31 --all, -a
32 Recursively remove all unused pods, containers, images, networks, and
33 volume data. (Maximum 50 iterations.)
34
35
36 --external
37 Removes all leftover container storage files from local storage not
38 managed by Podman. In normal circumstances, no such data exists, but in
39 case of an unclean shutdown, the Podman database may be corrupted and
40 cause this.
41
42
43 However, when using transient storage mode, the Podman database does
44 not persist. This means containers leave the writable layers on disk
45 after a reboot. When using a transient store, it is recommended that
46 the podman system prune --external command is run during boot.
47
48
49 This option is incompatible with --all and --filter and drops the de‐
50 fault behaviour of removing unused resources.
51
52
53 --filter=filters
54 Provide filter values.
55
56
57 The filters argument format is of key=value. If there is more than one
58 filter, then pass multiple OPTIONS: --filter foo=bar --filter bif=baz.
59
60
61 Supported filters:
62
63
64 ┌───────┬────────────────────────────┐
65 │Filter │ Description │
66 ├───────┼────────────────────────────┤
67 │label │ Only remove containers and │
68 │ │ images, with (or without, │
69 │ │ in the case of la‐ │
70 │ │ bel!=[...] is used) the │
71 │ │ specified labels. │
72 ├───────┼────────────────────────────┤
73 │until │ Only remove containers and │
74 │ │ images created before │
75 │ │ given timestamp. │
76 └───────┴────────────────────────────┘
77
78 The label filter accepts two formats. One is the label=key or la‐
79 bel=key=value, which removes containers and images with the specified
80 labels. The other format is the label!=key or label!=key=value, which
81 removes containers and images without the specified labels.
82
83
84 The until filter can be Unix timestamps, date formatted timestamps, or
85 Go duration strings (e.g. 10m, 1h30m) computed relative to the ma‐
86 chine’s time.
87
88
89 --force, -f
90 Do not prompt for confirmation
91
92
93 --help, -h
94 Print usage statement
95
96
97 --volumes
98 Prune volumes currently unused by any container
99
100
102 podman(1), podman-system(1)
103
104
106 February 2019, Originally compiled by Dan Walsh (dwalsh at redhat dot
107 com) December 2020, converted filter information from docs.docker.com
108 documentation by Dan Walsh (dwalsh at redhat dot com)
109
110
111
112 podman-system-prune(1)