1podman-ps(1)                General Commands Manual               podman-ps(1)
2
3
4

NAME

6       podman-ps - Print out information about containers
7
8

SYNOPSIS

10       podman ps [options]
11
12
13       podman container ps [options]
14
15
16       podman container list [options]
17
18
19       podman container ls [options]
20
21

DESCRIPTION

23       podman  ps  lists  the  running containers on the system. Use the --all
24       flag to view all the containers information.  By default it lists:
25
26
27              • container id
28
29              • the name of the image the container is using
30
31              • the COMMAND the container is executing
32
33              • the time the container was created
34
35              • the status of the container
36
37              • port mappings the container is using
38
39              • alternative names for the container
40
41
42

OPTIONS

44   --all, -a
45       Show all the containers created by Podman, default is only running con‐
46       tainers.
47
48
49       Note: Podman shares containers storage with other tools such as Buildah
50       and CRI-O. In some cases these external containers might also exist  in
51       the  same storage. Use the --external option to see these external con‐
52       tainers. External containers show the 'storage' status.
53
54
55   --external
56       Display external containers that are not controlled by Podman  but  are
57       stored  in containers storage.  These external containers are generally
58       created via other container technology such as Buildah or CRI-O and may
59       depend  on the same container images that Podman is also using.  Exter‐
60       nal containers are denoted with either a 'buildah' or 'storage' in  the
61       COMMAND and STATUS column of the ps output.
62
63
64   --filter, -f
65       Filter  what  containers are shown in the output.  Multiple filters can
66       be given with multiple uses of the --filter  flag.   Filters  with  the
67       same  key  work  inclusive with the only exception being label which is
68       exclusive. Filters with different keys always work exclusive.
69
70
71       Valid filters are listed below:
72
73
74       ┌─────────┬───────────────────────────────┐
75Filter   Description                   
76       ├─────────┼───────────────────────────────┤
77id       │ [ID] Container's ID (CID pre‐ │
78       │         │ fix match by default; accepts │
79       │         │ regex)                        │
80       ├─────────┼───────────────────────────────┤
81name     │ [Name] Container's name  (ac‐ │
82       │         │ cepts regex)                  │
83       ├─────────┼───────────────────────────────┤
84label    │ [Key]  or  [Key=Value]  Label │
85       │         │ assigned to a container       │
86       ├─────────┼───────────────────────────────┤
87label!   │ [Key]  or  [Key=Value]  Label │
88       │         │ NOT assigned to a container   │
89       ├─────────┼───────────────────────────────┤
90exited   [Int] Container's exit code   
91       ├─────────┼───────────────────────────────┤
92status   │ [Status]  Container's status: │
93       │         │ 'created',          'exited', │
94       │         │ 'paused',   'running',   'un‐ │
95       │         │ known'                        │
96       ├─────────┼───────────────────────────────┤
97ancestor │ [ImageName] Image or  descen‐ │
98       │         │ dant used to create container │
99       │         │ (accepts regex)               │
100       ├─────────┼───────────────────────────────┤
101before   │ [ID]  or  [Name]   Containers │
102       │         │ created before this container │
103       ├─────────┼───────────────────────────────┤
104since    │ [ID]   or  [Name]  Containers │
105       │         │ created since this container  │
106       ├─────────┼───────────────────────────────┤
107volume   │ [VolumeName] or  [Mountpoint‐ │
108       │         │ Destination]  Volume  mounted │
109       │         │ in container                  │
110       ├─────────┼───────────────────────────────┤
111health   [Status] healthy or unhealthy 
112       ├─────────┼───────────────────────────────┤
113pod      │ [Pod] name or full or partial │
114       │         │ ID of pod                     │
115       ├─────────┼───────────────────────────────┤
116network  │ [Network]  name or full ID of │
117       │         │ network                       │
118       ├─────────┼───────────────────────────────┤
119until    │ [DateTime] container  created │
120       │         │ before  the given duration or │
121       │         │ time.                         │
122       └─────────┴───────────────────────────────┘
123
124   --format=format
125       Pretty-print containers to JSON or using a Go template
126
127
128       Valid placeholders for the Go template are listed below:
129
130
131       ┌──────────────┬────────────────────────────────┐
132Placeholder   Description                    
133       ├──────────────┼────────────────────────────────┤
134.AutoRemove   │ If true,  containers  are  re‐ │
135       │              │ moved on exit                  │
136       ├──────────────┼────────────────────────────────┤
137.CIDFile      Container ID File              
138       ├──────────────┼────────────────────────────────┤
139.Command      Quoted command used            
140       ├──────────────┼────────────────────────────────┤
141.Created      │ Creation  time  for container, │
142       │              │ Y-M-D H:M:S                    │
143       ├──────────────┼────────────────────────────────┤
144.CreatedAt    │ Creation  time  for  container │
145       │              │ (same as above)                │
146       ├──────────────┼────────────────────────────────┤
147.CreatedHuman Creation time, relative        
148       ├──────────────┼────────────────────────────────┤
149.ExitCode     Container exit code            
150       ├──────────────┼────────────────────────────────┤
151.Exited       "true" if container has exited 
152       ├──────────────┼────────────────────────────────┤
153.ExitedAt     │ Time (epoch seconds) that con‐ │
154       │              │ tainer exited                  │
155       ├──────────────┼────────────────────────────────┤
156.ID           Container ID                   
157       ├──────────────┼────────────────────────────────┤
158.Image        Image Name/ID                  
159       ├──────────────┼────────────────────────────────┤
160.ImageID      Image ID                       
161       ├──────────────┼────────────────────────────────┤
162.IsInfra      "true" if infra container      
163       ├──────────────┼────────────────────────────────┤
164.Labels       │ All the labels assigned to the │
165       │              │ container                      │
166       ├──────────────┼────────────────────────────────┤
167.Mounts       │ Volumes  mounted  in  the con‐ │
168       │              │ tainer                         │
169       ├──────────────┼────────────────────────────────┤
170.Names        Name of container              
171       ├──────────────┼────────────────────────────────┤
172.Networks     │ Show all networks connected to │
173       │              │ the container                  │
174       ├──────────────┼────────────────────────────────┤
175.Pid          Process ID on host system      
176       ├──────────────┼────────────────────────────────┤
177.Pod          │ Pod  the  container is associ‐ │
178       │              │ ated with (SHA)                │
179       ├──────────────┼────────────────────────────────┤
180.PodName      │ Seems to be  empty  no  matter │
181       │              │ what                           │
182       ├──────────────┼────────────────────────────────┤
183.Ports        Exposed ports                  
184       ├──────────────┼────────────────────────────────┤
185.Restarts     │ Display  the container restart │
186       │              │ count                          │
187       ├──────────────┼────────────────────────────────┤
188.RunningFor   │ Time elapsed  since  container │
189       │              │ was started                    │
190       ├──────────────┼────────────────────────────────┤
191.Size         Size of container              
192       ├──────────────┼────────────────────────────────┤
193.StartedAt    │ Time  (epoch seconds) the con‐ │
194       │              │ tainer started                 │
195       ├──────────────┼────────────────────────────────┤
196.State        │ Human-friendly description  of │
197       │              │ ctr state                      │
198       ├──────────────┼────────────────────────────────┤
199.Status       Status of container            
200       └──────────────┴────────────────────────────────┘
201
202   --help, -h
203       Print usage statement
204
205
206   --last, -n
207       Print the n last created containers (all states)
208
209
210   --latest, -l
211       Show  the  latest  container  created  (all states) (This option is not
212       available with the remote Podman client, including Mac and Windows (ex‐
213       cluding WSL2) machines)
214
215
216   --namespace, --ns
217       Display namespace information
218
219
220   --no-trunc
221       Do not truncate the output (default false).
222
223
224   --noheading
225       Omit the table headings from the listing of containers.
226
227
228   --pod, -p
229       Display the pods the containers are associated with
230
231
232   --quiet, -q
233       Print the numeric IDs of the containers only
234
235
236   --size, -s
237       Display the total file size
238
239
240   --sort=created
241       Sort  by  command, created, id, image, names, runningfor, size, or sta‐
242       tus", Note: Choosing size sorts by size of rootFs,  not  alphabetically
243       like the rest of the options
244
245
246   --sync
247       Force a sync of container state with the OCI runtime.  In some cases, a
248       container's state in the runtime can become out of sync  with  Podman's
249       state.   This  updates Podman's state based on what the OCI runtime re‐
250       ports.  Forcibly syncing is much slower, but can  resolve  inconsistent
251       state issues.
252
253
254   --watch, -w
255       Refresh the output with current containers on an interval in seconds.
256
257

EXAMPLES

259       $ podman ps -a
260       CONTAINER ID   IMAGE         COMMAND         CREATED       STATUS                    PORTS     NAMES
261       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
262       69ed779d8ef9f  redis:alpine  "redis-server"  25 hours ago  Created                   6379/tcp  k8s_container1_podsandbox1_redhat.test.crio_redhat-test-crio_1
263
264
265       $ podman ps -a -s
266       CONTAINER ID   IMAGE         COMMAND         CREATED       STATUS                    PORTS     NAMES                                                                  SIZE
267       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
268       69ed779d8ef9f  redis:alpine  "redis-server"  25 hours ago  Created                   6379/tcp  k8s_container1_podsandbox1_redhat.test.crio_redhat-test-crio_1         27.49 MB
269
270
271       $ podman ps -a --format "{{.ID}}  {{.Image}}  {{.Labels}}  {{.Mounts}}"
272       02f65160e14ca  redis:alpine  tier=backend  proc,tmpfs,devpts,shm,mqueue,sysfs,cgroup,/var/run/,/var/run/
273       69ed779d8ef9f  redis:alpine  batch=no,type=small  proc,tmpfs,devpts,shm,mqueue,sysfs,cgroup,/var/run/,/var/run/
274
275
276       $ podman ps --ns -a
277       CONTAINER ID    NAMES                                                                   PID     CGROUP       IPC          MNT          NET          PIDNS        USER         UTS
278       3557d882a82e3   k8s_container2_podsandbox1_redhat.test.crio_redhat-test-crio_1          29910   4026531835   4026532585   4026532593   4026532508   4026532595   4026531837   4026532594
279       09564cdae0bec   k8s_container1_podsandbox1_redhat.test.crio_redhat-test-crio_1          29851   4026531835   4026532585   4026532590   4026532508   4026532592   4026531837   4026532591
280       a31ebbee9cee7   k8s_podsandbox1-redis_podsandbox1_redhat.test.crio_redhat-test-crio_0   29717   4026531835   4026532585   4026532587   4026532508   4026532589   4026531837   4026532588
281
282
283       $ podman ps -a --size --sort names
284       CONTAINER ID   IMAGE         COMMAND         CREATED       STATUS                    PORTS     NAMES
285       69ed779d8ef9f  redis:alpine  "redis-server"  25 hours ago  Created                   6379/tcp  k8s_container1_podsandbox1_redhat.test.crio_redhat-test-crio_1
286       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
287
288
289       $ podman ps
290       CONTAINER ID  IMAGE                            COMMAND    CREATED        STATUS        PORTS                                                   NAMES
291       4089df24d4f3  docker.io/library/centos:latest  /bin/bash  2 minutes ago  Up 2 minutes  0.0.0.0:80->8080/tcp, 0.0.0.0:2000-2006->2000-2006/tcp  manyports
292       92f58933c28c  docker.io/library/centos:latest  /bin/bash  3 minutes ago  Up 3 minutes  192.168.99.100:1000-1006->1000-1006/tcp                 zen_sanderson
293
294
295
296       $ podman ps --external -a
297       CONTAINER ID  IMAGE                             COMMAND  CREATED      STATUS  PORTS  NAMES
298       69ed779d8ef9f  redis:alpine  "redis-server"  25 hours ago  Created                   6379/tcp  k8s_container1_podsandbox1_redhat.test.crio_redhat-test-crio_1
299       38a8a78596f9  docker.io/library/busybox:latest  buildah  2 hours ago  storage        busybox-working-container
300       fd7b786b5c32  docker.io/library/alpine:latest   buildah  2 hours ago  storage        alpine-working-container
301       f78620804e00  scratch                           buildah  2 hours ago  storage        working-container
302
303
304

ps

306       Print a list of containers
307
308

SEE ALSO

310       podman(1), buildah(1), crio(8)
311
312

HISTORY

314       August 2017, Originally compiled by Urvashi Mohnani umohnani@redhat.com
315       ⟨mailto:umohnani@redhat.com⟩
316
317
318
319                                                                  podman-ps(1)
Impressum