1podman-restart(1) General Commands Manual podman-restart(1)
2
3
4
6 podman-restart - Restart one or more containers
7
8
10 podman restart [options] container ...
11
12
13 podman container restart [options] container ...
14
15
17 The restart command allows containers to be restarted using their ID or
18 name. Running containers are stopped and restarted. Stopped containers
19 are started.
20
21
23 --all, -a
24 Restart all containers regardless of their current state.
25
26
27 --cidfile
28 Read container ID from the specified file and restart the container.
29 Can be specified multiple times.
30
31
32 --filter, -f=filter
33 Filter what containers restart. Multiple filters can be given with
34 multiple uses of the --filter flag. Filters with the same key work in‐
35 clusive with the only exception being label which is exclusive. Filters
36 with different keys always work exclusive.
37
38
39 Valid filters are listed below:
40
41
42 ┌─────────┬───────────────────────────────┐
43 │Filter │ Description │
44 ├─────────┼───────────────────────────────┤
45 │id │ [ID] Container's ID (CID pre‐ │
46 │ │ fix match by default; accepts │
47 │ │ regex) │
48 ├─────────┼───────────────────────────────┤
49 │name │ [Name] Container's name (ac‐ │
50 │ │ cepts regex) │
51 ├─────────┼───────────────────────────────┤
52 │label │ [Key] or [Key=Value] Label │
53 │ │ assigned to a container │
54 ├─────────┼───────────────────────────────┤
55 │exited │ [Int] Container's exit code │
56 ├─────────┼───────────────────────────────┤
57 │status │ [Status] Container's status: │
58 │ │ 'created', 'exited', │
59 │ │ 'paused', 'running', 'un‐ │
60 │ │ known' │
61 ├─────────┼───────────────────────────────┤
62 │ancestor │ [ImageName] Image or descen‐ │
63 │ │ dant used to create container │
64 ├─────────┼───────────────────────────────┤
65 │before │ [ID] or [Name] Containers │
66 │ │ created before this container │
67 ├─────────┼───────────────────────────────┤
68 │since │ [ID] or [Name] Containers │
69 │ │ created since this container │
70 ├─────────┼───────────────────────────────┤
71 │volume │ [VolumeName] or [Mountpoint‐ │
72 │ │ Destination] Volume mounted │
73 │ │ in container │
74 ├─────────┼───────────────────────────────┤
75 │health │ [Status] healthy or unhealthy │
76 ├─────────┼───────────────────────────────┤
77 │pod │ [Pod] name or full or partial │
78 │ │ ID of pod │
79 ├─────────┼───────────────────────────────┤
80 │network │ [Network] name or full ID of │
81 │ │ network │
82 └─────────┴───────────────────────────────┘
83
84 --latest, -l
85 Instead of providing the container name or ID, use the last created
86 container. Note: the last started container can be from other users of
87 Podman on the host machine. (This option is not available with the re‐
88 mote Podman client, including Mac and Windows (excluding WSL2) ma‐
89 chines)
90
91
92 --running
93 Restart all containers that are already in the running state.
94
95
96 --time, -t=seconds
97 Seconds to wait before forcibly stopping the container. Use -1 for in‐
98 finite wait.
99
100
102 Restart the latest container
103
104
105 $ podman restart -l
106 ec588fc80b05e19d3006bf2e8aa325f0a2e2ff1f609b7afb39176ca8e3e13467
107
108
109
110 Restart a specific container by partial container ID
111
112
113 $ podman restart ff6cf1
114 ff6cf1e5e77e6dba1efc7f3fcdb20e8b89ad8947bc0518be1fcb2c78681f226f
115
116
117
118 Restart two containers by name with a timeout of 4 seconds
119
120
121 $ podman restart --time 4 test1 test2
122 c3bb026838c30e5097f079fa365c9a4769d52e1017588278fa00d5c68ebc1502
123 17e13a63081a995136f907024bcfe50ff532917988a152da229db9d894c5a9ec
124
125
126
127 Restart all running containers
128
129
130 $ podman restart --running
131
132
133
134 Restart all containers
135
136
137 $ podman restart --all
138
139
140
141 Restart container using ID specified in a given files.
142
143
144 $ podman restart --cidfile /home/user/cidfile-1
145 $ podman restart --cidfile /home/user/cidfile-1 --cidfile ./cidfile-2
146
147
148
150 podman(1)
151
152
154 March 2018, Originally compiled by Matt Heon mheon@redhat.com
155 ⟨mailto:mheon@redhat.com⟩
156
157
158
159 podman-restart(1)