2018-08-30 08:41:19 +00:00
|
|
|
% podman-ps(1)
|
2017-11-01 15:24:59 +00:00
|
|
|
|
|
|
|
## NAME
|
2018-04-26 13:21:11 +00:00
|
|
|
podman\-ps - Prints out information about containers
|
2017-11-01 15:24:59 +00:00
|
|
|
|
|
|
|
## SYNOPSIS
|
2018-06-29 17:53:33 +00:00
|
|
|
**podman ps** [*options*]
|
2017-11-01 15:24:59 +00:00
|
|
|
|
|
|
|
## DESCRIPTION
|
2017-12-15 21:58:36 +00:00
|
|
|
**podman ps** lists the running containers on the system. Use the **--all** flag to view
|
2017-11-01 15:24:59 +00:00
|
|
|
all the containers information. By default it lists:
|
|
|
|
|
|
|
|
* container id
|
|
|
|
* the name of the image the container is using
|
|
|
|
* the COMMAND the container is executing
|
|
|
|
* the time the container was created
|
|
|
|
* the status of the container
|
|
|
|
* port mappings the container is using
|
|
|
|
* alternative names for the container
|
|
|
|
|
|
|
|
## OPTIONS
|
|
|
|
|
|
|
|
**--all, -a**
|
2018-06-14 15:44:39 +00:00
|
|
|
|
|
|
|
Show all the containers, default is only running containers
|
2017-11-01 15:24:59 +00:00
|
|
|
|
2018-11-30 15:15:11 +00:00
|
|
|
**--pod, -p**
|
2018-08-02 14:48:56 +00:00
|
|
|
|
|
|
|
Display the pods the containers are associated with
|
|
|
|
|
2017-11-01 15:24:59 +00:00
|
|
|
**--no-trunc**
|
2018-06-14 15:44:39 +00:00
|
|
|
|
|
|
|
Display the extended information
|
2017-11-01 15:24:59 +00:00
|
|
|
|
|
|
|
**--quiet, -q**
|
2018-06-14 15:44:39 +00:00
|
|
|
|
|
|
|
Print the numeric IDs of the containers only
|
2017-11-01 15:24:59 +00:00
|
|
|
|
|
|
|
**--format**
|
2018-06-14 15:44:39 +00:00
|
|
|
|
|
|
|
Pretty-print containers to JSON or using a Go template
|
2017-11-01 15:24:59 +00:00
|
|
|
|
|
|
|
Valid placeholders for the Go template are listed below:
|
|
|
|
|
|
|
|
| **Placeholder** | **Description** |
|
|
|
|
| --------------- | ------------------------------------------------ |
|
|
|
|
| .ID | Container ID |
|
|
|
|
| .Image | Image ID/Name |
|
|
|
|
| .Command | Quoted command used |
|
|
|
|
| .CreatedAt | Creation time for container |
|
|
|
|
| .RunningFor | Time elapsed since container was started |
|
|
|
|
| .Status | Status of container |
|
2018-08-02 14:48:56 +00:00
|
|
|
| .Pod | Pod the container is associated with |
|
2017-11-01 15:24:59 +00:00
|
|
|
| .Ports | Exposed ports |
|
|
|
|
| .Size | Size of container |
|
|
|
|
| .Names | Name of container |
|
|
|
|
| .Labels | All the labels assigned to the container |
|
|
|
|
| .Mounts | Volumes mounted in the container |
|
|
|
|
|
2018-06-14 19:29:46 +00:00
|
|
|
**--sort**
|
|
|
|
|
|
|
|
Sort by command, created, id, image, names, runningfor, size, or status",
|
|
|
|
Note: Choosing size will sort by size of rootFs, not alphabetically like the rest of the options
|
|
|
|
Default: created
|
2017-11-01 15:24:59 +00:00
|
|
|
|
|
|
|
**--size, -s**
|
2018-06-14 15:44:39 +00:00
|
|
|
|
|
|
|
Display the total file size
|
2017-11-01 15:24:59 +00:00
|
|
|
|
|
|
|
**--last, -n**
|
2018-06-14 15:44:39 +00:00
|
|
|
|
|
|
|
Print the n last created containers (all states)
|
2017-11-01 15:24:59 +00:00
|
|
|
|
|
|
|
**--latest, -l**
|
2018-06-14 15:44:39 +00:00
|
|
|
|
|
|
|
Show the latest container created (all states)
|
2017-11-01 15:24:59 +00:00
|
|
|
|
2019-02-21 23:09:59 +00:00
|
|
|
The latest option is not supported on the remote client.
|
|
|
|
|
2017-11-01 15:24:59 +00:00
|
|
|
**--namespace, --ns**
|
2018-06-14 15:44:39 +00:00
|
|
|
|
|
|
|
Display namespace information
|
2017-11-01 15:24:59 +00:00
|
|
|
|
|
|
|
**--filter, -f**
|
2018-06-14 15:44:39 +00:00
|
|
|
|
2018-08-27 13:14:19 +00:00
|
|
|
Filter what containers are shown in the output.
|
|
|
|
Multiple filters can be given with multiple uses of the --filter flag.
|
|
|
|
If multiple filters are given, only containers which match all of the given filters will be shown.
|
2017-11-01 15:24:59 +00:00
|
|
|
|
|
|
|
Valid filters are listed below:
|
|
|
|
|
|
|
|
| **Filter** | **Description** |
|
|
|
|
| --------------- | ------------------------------------------------------------------- |
|
|
|
|
| id | [ID] Container's ID |
|
|
|
|
| name | [Name] Container's name |
|
|
|
|
| label | [Key] or [Key=Value] Label assigned to a container |
|
|
|
|
| exited | [Int] Container's exit code |
|
|
|
|
| status | [Status] Container's status, e.g *running*, *stopped* |
|
|
|
|
| ancestor | [ImageName] Image or descendant used to create container |
|
|
|
|
| before | [ID] or [Name] Containers created before this container |
|
|
|
|
| since | [ID] or [Name] Containers created since this container |
|
|
|
|
| volume | [VolumeName] or [MountpointDestination] Volume mounted in container |
|
|
|
|
|
2018-06-29 17:53:33 +00:00
|
|
|
**--help**, **-h**
|
|
|
|
|
|
|
|
Print usage statement
|
|
|
|
|
2018-11-28 17:48:58 +00:00
|
|
|
**--sync**
|
|
|
|
|
|
|
|
Force a sync of container state with the OCI runtime.
|
|
|
|
In some cases, a container's state in the runtime can become out of sync with Podman's state.
|
|
|
|
This will update Podman's state based on what the OCI runtime reports.
|
|
|
|
Forcibly syncing is much slower, but can resolve inconsistent state issues.
|
|
|
|
|
2017-11-01 15:24:59 +00:00
|
|
|
## EXAMPLES
|
|
|
|
|
|
|
|
```
|
2018-08-30 11:05:37 +00:00
|
|
|
$ podman ps -a
|
2017-11-01 15:24:59 +00:00
|
|
|
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
|
|
|
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
|
|
|
|
69ed779d8ef9f redis:alpine "redis-server" 25 hours ago Created 6379/tcp k8s_container1_podsandbox1_redhat.test.crio_redhat-test-crio_1
|
|
|
|
```
|
|
|
|
|
|
|
|
```
|
2018-08-30 11:05:37 +00:00
|
|
|
$ podman ps -a -s
|
2017-11-01 15:24:59 +00:00
|
|
|
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES SIZE
|
|
|
|
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
|
|
|
|
69ed779d8ef9f redis:alpine "redis-server" 25 hours ago Created 6379/tcp k8s_container1_podsandbox1_redhat.test.crio_redhat-test-crio_1 27.49 MB
|
|
|
|
```
|
|
|
|
|
|
|
|
```
|
2018-08-30 11:05:37 +00:00
|
|
|
$ podman ps -a --format "{{.ID}} {{.Image}} {{.Labels}} {{.Mounts}}"
|
2017-11-01 15:24:59 +00:00
|
|
|
02f65160e14ca redis:alpine tier=backend proc,tmpfs,devpts,shm,mqueue,sysfs,cgroup,/var/run/,/var/run/
|
|
|
|
69ed779d8ef9f redis:alpine batch=no,type=small proc,tmpfs,devpts,shm,mqueue,sysfs,cgroup,/var/run/,/var/run/
|
|
|
|
```
|
|
|
|
|
|
|
|
```
|
2018-08-30 11:05:37 +00:00
|
|
|
$ podman ps --ns -a
|
2017-11-01 15:24:59 +00:00
|
|
|
CONTAINER ID NAMES PID CGROUP IPC MNT NET PIDNS USER UTS
|
|
|
|
3557d882a82e3 k8s_container2_podsandbox1_redhat.test.crio_redhat-test-crio_1 29910 4026531835 4026532585 4026532593 4026532508 4026532595 4026531837 4026532594
|
|
|
|
09564cdae0bec k8s_container1_podsandbox1_redhat.test.crio_redhat-test-crio_1 29851 4026531835 4026532585 4026532590 4026532508 4026532592 4026531837 4026532591
|
|
|
|
a31ebbee9cee7 k8s_podsandbox1-redis_podsandbox1_redhat.test.crio_redhat-test-crio_0 29717 4026531835 4026532585 4026532587 4026532508 4026532589 4026531837 4026532588
|
|
|
|
```
|
|
|
|
|
2018-06-14 19:29:46 +00:00
|
|
|
```
|
2018-08-30 11:05:37 +00:00
|
|
|
$ podman ps -a --size --sort names
|
2018-06-14 19:29:46 +00:00
|
|
|
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
|
|
|
69ed779d8ef9f redis:alpine "redis-server" 25 hours ago Created 6379/tcp k8s_container1_podsandbox1_redhat.test.crio_redhat-test-crio_1
|
|
|
|
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
|
|
|
|
```
|
2017-11-01 15:24:59 +00:00
|
|
|
## ps
|
|
|
|
Print a list of containers
|
|
|
|
|
|
|
|
## SEE ALSO
|
2018-03-12 14:00:14 +00:00
|
|
|
podman(1), crio(8)
|
2017-11-01 15:24:59 +00:00
|
|
|
|
|
|
|
## HISTORY
|
|
|
|
August 2017, Originally compiled by Urvashi Mohnani <umohnani@redhat.com>
|