335 lines
12 KiB
Groff
335 lines
12 KiB
Groff
'\" t
|
|
.nh
|
|
.TH podman-ps 1
|
|
.SH NAME
|
|
podman-ps \- Print out information about containers
|
|
|
|
.SH SYNOPSIS
|
|
\fBpodman ps\fP [\fIoptions\fP]
|
|
|
|
.PP
|
|
\fBpodman container ps\fP [\fIoptions\fP]
|
|
|
|
.PP
|
|
\fBpodman container list\fP [\fIoptions\fP]
|
|
|
|
.PP
|
|
\fBpodman container ls\fP [\fIoptions\fP]
|
|
|
|
.SH DESCRIPTION
|
|
\fBpodman ps\fP lists the running containers on the system. Use the \fB--all\fP flag to view
|
|
all the containers information. By default it lists:
|
|
.IP \(bu 2
|
|
container id
|
|
.IP \(bu 2
|
|
the name of the image the container is using
|
|
.IP \(bu 2
|
|
the COMMAND the container is executing
|
|
.IP \(bu 2
|
|
the time the container was created
|
|
.IP \(bu 2
|
|
the status of the container
|
|
.IP \(bu 2
|
|
port mappings the container is using
|
|
.IP \(bu 2
|
|
alternative names for the container
|
|
|
|
.SH OPTIONS
|
|
.SS \fB--all\fP, \fB-a\fP
|
|
Show all the containers, default is only running containers.
|
|
|
|
.PP
|
|
Note: Podman shares containers storage with other tools such as Buildah and CRI-O. In some cases these \fBexternal\fR containers might also exist in the same storage. Use the \fB--external\fR option to see these external containers. External containers show the 'storage' status.
|
|
|
|
.SS \fB--external\fP
|
|
Display external containers that are not controlled by Podman but are stored in containers storage. These external containers are generally created via other container technology such as Buildah or CRI-O and may depend on the same container images that Podman is also using. External containers are denoted with either a 'buildah' or 'storage' in the COMMAND and STATUS column of the ps output.
|
|
|
|
.SS \fB--filter\fP, \fB-f\fP
|
|
Filter what containers are shown in the output.
|
|
Multiple filters can be given with multiple uses of the --filter flag.
|
|
Filters with the same key work inclusive with the only exception being
|
|
\fBlabel\fR which is exclusive. Filters with different keys always work exclusive.
|
|
|
|
.PP
|
|
Valid filters are listed below:
|
|
|
|
.TS
|
|
allbox;
|
|
l l
|
|
l l .
|
|
\fB\fBFilter\fP\fP \fB\fBDescription\fP\fP
|
|
id T{
|
|
[ID] Container's ID (CID prefix match by default; accepts regex)
|
|
T}
|
|
name T{
|
|
[Name] Container's name (accepts regex)
|
|
T}
|
|
label T{
|
|
[Key] or [Key=Value] Label assigned to a container
|
|
T}
|
|
label! T{
|
|
[Key] or [Key=Value] Label NOT assigned to a container
|
|
T}
|
|
exited [Int] Container's exit code
|
|
status T{
|
|
[Status] Container's status: 'created', 'initialized', 'exited', 'paused', 'running', 'unknown'
|
|
T}
|
|
ancestor T{
|
|
[ImageName] Image or descendant used to create container (accepts regex)
|
|
T}
|
|
before T{
|
|
[ID] or [Name] Containers created before this container
|
|
T}
|
|
since T{
|
|
[ID] or [Name] Containers created since this container
|
|
T}
|
|
volume T{
|
|
[VolumeName] or [MountpointDestination] Volume mounted in container
|
|
T}
|
|
health [Status] healthy or unhealthy
|
|
pod T{
|
|
[Pod] name or full or partial ID of pod
|
|
T}
|
|
network T{
|
|
[Network] name or full ID of network
|
|
T}
|
|
until T{
|
|
[DateTime] container created before the given duration or time.
|
|
T}
|
|
command T{
|
|
[Command] the command the container is executing, only argv[0] is taken
|
|
T}
|
|
.TE
|
|
|
|
.SS \fB--format\fP=\fIformat\fP
|
|
Pretty-print containers to JSON or using a Go template
|
|
|
|
.PP
|
|
Valid placeholders for the Go template are listed below:
|
|
|
|
.TS
|
|
allbox;
|
|
l l
|
|
l l .
|
|
\fB\fBPlaceholder\fP\fP \fB\fBDescription\fP\fP
|
|
\&.AutoRemove T{
|
|
If true, containers are removed on exit
|
|
T}
|
|
\&.CIDFile Container ID File
|
|
\&.Command Quoted command used
|
|
\&.Created ... T{
|
|
Creation time for container, Y-M-D H:M:S
|
|
T}
|
|
\&.CreatedAt T{
|
|
Creation time for container (same as above)
|
|
T}
|
|
\&.CreatedHuman Creation time, relative
|
|
\&.ExitCode Container exit code
|
|
\&.Exited "true" if container has exited
|
|
\&.ExitedAt T{
|
|
Time (epoch seconds) that container exited
|
|
T}
|
|
\&.ExposedPorts ... T{
|
|
Map of exposed ports on this container
|
|
T}
|
|
\&.ID Container ID
|
|
\&.Image Image Name/ID
|
|
\&.ImageID Image ID
|
|
\&.IsInfra "true" if infra container
|
|
\&.Label \fIstring\fP T{
|
|
Specified label of the container
|
|
T}
|
|
\&.Labels ... T{
|
|
All the labels assigned to the container
|
|
T}
|
|
\&.Mounts T{
|
|
Volumes mounted in the container
|
|
T}
|
|
\&.Names Name of container
|
|
\&.Networks T{
|
|
Show all networks connected to the container
|
|
T}
|
|
\&.Pid Process ID on host system
|
|
\&.Pod T{
|
|
Pod the container is associated with (SHA)
|
|
T}
|
|
\&.PodName PodName of the container
|
|
\&.Ports Forwarded and exposed ports
|
|
\&.Restarts T{
|
|
Display the container restart count
|
|
T}
|
|
\&.RunningFor T{
|
|
Time elapsed since container was started
|
|
T}
|
|
\&.Size Size of container
|
|
\&.StartedAt T{
|
|
Time (epoch seconds) the container started
|
|
T}
|
|
\&.State T{
|
|
Human-friendly description of ctr state
|
|
T}
|
|
\&.Status Status of container
|
|
.TE
|
|
|
|
.SS \fB--help\fP, \fB-h\fP
|
|
Print usage statement
|
|
|
|
.SS \fB--last\fP, \fB-n\fP
|
|
Print the n last created containers (all states)
|
|
|
|
.SS \fB--latest\fP, \fB-l\fP
|
|
Show the latest container created (all states) (This option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines)
|
|
|
|
.SS \fB--namespace\fP, \fB--ns\fP
|
|
Display namespace information
|
|
|
|
.SS \fB--no-trunc\fP
|
|
Do not truncate the output (default \fIfalse\fP).
|
|
|
|
.SS \fB--noheading\fP
|
|
Omit the table headings from the listing of containers.
|
|
|
|
.SS \fB--pod\fP, \fB-p\fP
|
|
Display the pods the containers are associated with
|
|
|
|
.SS \fB--quiet\fP, \fB-q\fP
|
|
Print the numeric IDs of the containers only
|
|
|
|
.SS \fB--size\fP, \fB-s\fP
|
|
Display the total file size
|
|
|
|
.SS \fB--sort\fP=\fIcreated\fP
|
|
Sort by command, created, id, image, names, runningfor, size, or status",
|
|
Note: Choosing size sorts by size of rootFs, not alphabetically like the rest of the options
|
|
|
|
.SS \fB--sync\fP
|
|
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 updates Podman's state based on what the OCI runtime reports.
|
|
Forcibly syncing is much slower, but can resolve inconsistent state issues.
|
|
|
|
.SS \fB--watch\fP, \fB-w\fP
|
|
Refresh the output with current containers on an interval in seconds.
|
|
|
|
.SH EXAMPLES
|
|
List running containers.
|
|
|
|
.EX
|
|
$ podman ps
|
|
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
|
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
|
|
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
|
|
.EE
|
|
|
|
.PP
|
|
List all containers.
|
|
|
|
.EX
|
|
$ podman ps -a
|
|
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
|
|
.EE
|
|
|
|
.PP
|
|
List all containers including their size. Note: this can take longer since Podman needs to calculate the size from the file system.
|
|
|
|
.EX
|
|
$ podman ps -a -s
|
|
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
|
|
.EE
|
|
|
|
.PP
|
|
List all containers, running or not, using a custom Go format.
|
|
|
|
.EX
|
|
$ podman ps -a --format "{{.ID}} {{.Image}} {{.Labels}} {{.Mounts}}"
|
|
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/
|
|
.EE
|
|
|
|
.PP
|
|
List all containers and display their namespaces.
|
|
|
|
.EX
|
|
$ podman ps --ns -a
|
|
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
|
|
.EE
|
|
|
|
.PP
|
|
List all containers including size sorted by names.
|
|
|
|
.EX
|
|
$ podman ps -a --size --sort names
|
|
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
|
|
.EE
|
|
|
|
.PP
|
|
List all external containers created by tools other than Podman.
|
|
|
|
.EX
|
|
$ podman ps --external -a
|
|
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
|
|
38a8a78596f9 docker.io/library/busybox:latest buildah 2 hours ago storage busybox-working-container
|
|
fd7b786b5c32 docker.io/library/alpine:latest buildah 2 hours ago storage alpine-working-container
|
|
f78620804e00 scratch buildah 2 hours ago storage working-container
|
|
.EE
|
|
|
|
.PP
|
|
List containers with their associated pods.
|
|
|
|
.EX
|
|
$ podman ps --pod
|
|
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES POD ID PODNAME
|
|
4089df24d4f3 docker.io/library/nginx:latest nginx 2 minutes ago Up 2 minutes 80/tcp webserver 1234567890ab web-pod
|
|
92f58933c28c docker.io/library/redis:latest redis 3 minutes ago Up 3 minutes 6379/tcp cache 1234567890ab web-pod
|
|
a1b2c3d4e5f6 docker.io/library/centos:latest /bin/bash 1 minute ago Up 1 minute standalone-container
|
|
.EE
|
|
|
|
.PP
|
|
List all containers with pod information, including those not in pods.
|
|
|
|
.EX
|
|
$ podman ps -a --pod
|
|
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES POD ID PODNAME
|
|
4089df24d4f3 docker.io/library/nginx:latest nginx 2 minutes ago Up 2 minutes 80/tcp webserver 1234567890ab web-pod
|
|
92f58933c28c docker.io/library/redis:latest redis 3 minutes ago Up 3 minutes 6379/tcp cache 1234567890ab web-pod
|
|
69ed779d8ef9f redis:alpine redis 25 hours ago Exited (0) 25 hours ago 6379/tcp old-cache 5678901234cd old-pod
|
|
a1b2c3d4e5f6 docker.io/library/centos:latest /bin/bash 1 minute ago Up 1 minute standalone-container
|
|
.EE
|
|
|
|
.PP
|
|
Filter containers by pod name.
|
|
|
|
.EX
|
|
$ podman ps --filter pod=web-pod
|
|
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
|
4089df24d4f3 docker.io/library/nginx:latest nginx 2 minutes ago Up 2 minutes 80/tcp webserver
|
|
92f58933c28c docker.io/library/redis:latest redis 3 minutes ago Up 3 minutes 6379/tcp cache
|
|
.EE
|
|
|
|
.PP
|
|
Use custom format to show container and pod information.
|
|
|
|
.EX
|
|
$ podman ps --format "{{.Names}} is in pod {{.PodName}} ({{.Pod}})"
|
|
webserver is in pod web-pod (1234567890ab)
|
|
cache is in pod web-pod (1234567890ab)
|
|
standalone-container is in pod ()
|
|
.EE
|
|
|
|
.SH SEE ALSO
|
|
\fBpodman(1)\fP, \fBbuildah(1)\fP, \fBcrio(8)\fP
|
|
|
|
.SH HISTORY
|
|
August 2017, Originally compiled by Urvashi Mohnani umohnani@redhat.com
|
|
\[la]mailto:umohnani@redhat.com\[ra]
|