1podman-ps(1) General Commands Manual podman-ps(1)
2
3
4
6 podman-ps - Prints out information about containers
7
8
10 podman ps [options]
11
12
14 podman ps lists the running containers on the system. Use the --all
15 flag to view all the containers information. By default it lists:
16
17
18 · container id
19
20 · the name of the image the container is using
21
22 · the COMMAND the container is executing
23
24 · the time the container was created
25
26 · the status of the container
27
28 · port mappings the container is using
29
30 · alternative names for the container
31
32
33
35 --all, -a
36
37
38 Show all the containers, default is only running containers
39
40
41 --pod, -p
42
43
44 Display the pods the containers are associated with
45
46
47 --no-trunc
48
49
50 Display the extended information
51
52
53 --quiet, -q
54
55
56 Print the numeric IDs of the containers only
57
58
59 --format
60
61
62 Pretty-print containers to JSON or using a Go template
63
64
65 Valid placeholders for the Go template are listed below:
66
67
68 ┌────────────┬─────────────────────────────┐
69 │Placeholder │ Description │
70 ├────────────┼─────────────────────────────┤
71 │.ID │ Container ID │
72 ├────────────┼─────────────────────────────┤
73 │.Image │ Image ID/Name │
74 ├────────────┼─────────────────────────────┤
75 │.Command │ Quoted command used │
76 ├────────────┼─────────────────────────────┤
77 │.CreatedAt │ Creation time for container │
78 ├────────────┼─────────────────────────────┤
79 │.RunningFor │ Time elapsed since │
80 │ │ container was started │
81 ├────────────┼─────────────────────────────┤
82 │.Status │ Status of container │
83 ├────────────┼─────────────────────────────┤
84 │.Pod │ Pod the container is │
85 │ │ associated with │
86 ├────────────┼─────────────────────────────┤
87 │.Ports │ Exposed ports │
88 ├────────────┼─────────────────────────────┤
89 │.Size │ Size of container │
90 ├────────────┼─────────────────────────────┤
91 │.Names │ Name of container │
92 ├────────────┼─────────────────────────────┤
93 │.Labels │ All the labels assigned to │
94 │ │ the container │
95 ├────────────┼─────────────────────────────┤
96 │.Mounts │ Volumes mounted in the │
97 │ │ container │
98 └────────────┴─────────────────────────────┘
99
100 --sort
101
102
103 Sort by command, created, id, image, names, runningfor, size, or
104 status", Note: Choosing size will sort by size of rootFs, not
105 alphabetically like the rest of the options Default: created
106
107
108 --size, -s
109
110
111 Display the total file size
112
113
114 --last, -n
115
116
117 Print the n last created containers (all states)
118
119
120 --latest, -l
121
122
123 Show the latest container created (all states)
124
125
126 The latest option is not supported on the remote client.
127
128
129 --namespace, --ns
130
131
132 Display namespace information
133
134
135 --filter, -f
136
137
138 Filter what containers are shown in the output. Multiple filters can
139 be given with multiple uses of the --filter flag. If multiple filters
140 are given, only containers which match all of the given filters will be
141 shown.
142
143
144 Valid filters are listed below:
145
146
147 ┌─────────┬───────────────────────────────┐
148 │Filter │ Description │
149 ├─────────┼───────────────────────────────┤
150 │id │ [ID] Container's ID │
151 ├─────────┼───────────────────────────────┤
152 │name │ [Name] Container's name │
153 ├─────────┼───────────────────────────────┤
154 │label │ [Key] or [Key=Value] Label │
155 │ │ assigned to a container │
156 ├─────────┼───────────────────────────────┤
157 │exited │ [Int] Container's exit code │
158 ├─────────┼───────────────────────────────┤
159 │status │ [Status] Container's status: │
160 │ │ created, exited, paused, │
161 │ │ running, unknown │
162 ├─────────┼───────────────────────────────┤
163 │ancestor │ [ImageName] Image or │
164 │ │ descendant used to create │
165 │ │ container │
166 ├─────────┼───────────────────────────────┤
167 │before │ [ID] or [Name] Containers │
168 │ │ created before this container │
169 ├─────────┼───────────────────────────────┤
170 │since │ [ID] or [Name] Containers │
171 │ │ created since this container │
172 ├─────────┼───────────────────────────────┤
173 │volume │ [VolumeName] or │
174 │ │ [MountpointDestination] │
175 │ │ Volume mounted in container │
176 ├─────────┼───────────────────────────────┤
177 │health │ [Status] healthy or unhealthy │
178 └─────────┴───────────────────────────────┘
179
180 --help, -h
181
182
183 Print usage statement
184
185
186 --sync
187
188
189 Force a sync of container state with the OCI runtime. In some cases, a
190 container's state in the runtime can become out of sync with Podman's
191 state. This will update Podman's state based on what the OCI runtime
192 reports. Forcibly syncing is much slower, but can resolve inconsistent
193 state issues.
194
195
196 --watch, -w
197
198
199 Refresh the output with current containers on an interval in seconds.
200
201
203 $ podman ps -a
204 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
205 02f65160e14ca redis:alpine "redis-server" 19 hours ago Exited (-1) 19 hours ago 6379/tcp k8s_podsandbox1-redis_podsandbox1_redhat.test.crio_redhat-test-crio_0
206 69ed779d8ef9f redis:alpine "redis-server" 25 hours ago Created 6379/tcp k8s_container1_podsandbox1_redhat.test.crio_redhat-test-crio_1
207
208
209
210 $ podman ps -a -s
211 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES SIZE
212 02f65160e14ca redis:alpine "redis-server" 20 hours ago Exited (-1) 20 hours ago 6379/tcp k8s_podsandbox1-redis_podsandbox1_redhat.test.crio_redhat-test-crio_0 27.49 MB
213 69ed779d8ef9f redis:alpine "redis-server" 25 hours ago Created 6379/tcp k8s_container1_podsandbox1_redhat.test.crio_redhat-test-crio_1 27.49 MB
214
215
216
217 $ podman ps -a --format "{{.ID}} {{.Image}} {{.Labels}} {{.Mounts}}"
218 02f65160e14ca redis:alpine tier=backend proc,tmpfs,devpts,shm,mqueue,sysfs,cgroup,/var/run/,/var/run/
219 69ed779d8ef9f redis:alpine batch=no,type=small proc,tmpfs,devpts,shm,mqueue,sysfs,cgroup,/var/run/,/var/run/
220
221
222
223 $ podman ps --ns -a
224 CONTAINER ID NAMES PID CGROUP IPC MNT NET PIDNS USER UTS
225 3557d882a82e3 k8s_container2_podsandbox1_redhat.test.crio_redhat-test-crio_1 29910 4026531835 4026532585 4026532593 4026532508 4026532595 4026531837 4026532594
226 09564cdae0bec k8s_container1_podsandbox1_redhat.test.crio_redhat-test-crio_1 29851 4026531835 4026532585 4026532590 4026532508 4026532592 4026531837 4026532591
227 a31ebbee9cee7 k8s_podsandbox1-redis_podsandbox1_redhat.test.crio_redhat-test-crio_0 29717 4026531835 4026532585 4026532587 4026532508 4026532589 4026531837 4026532588
228
229
230
231 $ podman ps -a --size --sort names
232 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
233 69ed779d8ef9f redis:alpine "redis-server" 25 hours ago Created 6379/tcp k8s_container1_podsandbox1_redhat.test.crio_redhat-test-crio_1
234 02f65160e14ca redis:alpine "redis-server" 19 hours ago Exited (-1) 19 hours ago 6379/tcp k8s_podsandbox1-redis_podsandbox1_redhat.test.crio_redhat-test-crio_0
235
236
237
238 $ podman ps
239 CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
240 4089df24d4f3 docker.io/library/centos:latest /bin/bash 2 minutes ago Up 2 minutes ago 0.0.0.0:80->8080/tcp, 0.0.0.0:2000-2006->2000-2006/tcp manyports
241 92f58933c28c docker.io/library/centos:latest /bin/bash 3 minutes ago Up 3 minutes ago 192.168.99.100:1000-1006->1000-1006/tcp zen_sanderson
242
243
244
245
247 Print a list of containers
248
249
251 podman(1)
252
253
255 August 2017, Originally compiled by Urvashi Mohnani
256 ⟨umohnani@redhat.com⟩
257
258
259
260 podman-ps(1)