podman-top(1)

πŸ“¦
version 6.1.4 Β· 6 versions
, in alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu resolute, ubuntu stonking

πŸ’– podman-top(1) β€” the girlies' guide to peeking inside your container πŸ’–

okay bestie, so this is a page from the General Commands Manual, and it's literally just about spying on what your container is doing in there. no cap.


✨ NAME ✨

podman-top β€” Display the running processes of a container


🌸 SYNOPSIS 🌸

podman top [options] container [format-descriptors]

podman container top [options] container [format-descriptors]

πŸ¦‹ DESCRIPTION πŸ¦‹

So basically, this shows you the running processes of the container. iconic, right? πŸ’…

The format-descriptors are ps(1) compatible AIX format descriptors, but they've been extended so you can also print extra stuff, like the seccomp mode or the effective capabilities of a given process. lowkey powerful.

You can pass those descriptors either as separate arguments, or as one single comma-separated argument. your call, queen πŸ‘‘

heads up: options and/or flags of ps(1) can also be specified! When you do that, Podman falls back to executing ps(1) from the host, with the specified arguments and flags, inside the container namespace. If the container has the CAP_SYS_PTRACE capability, then we execute ps(1) in the container, so it must be installed there. 🫣

To extract host-related information, use the "h*" descriptors. For instance, podman top $name hpid huser displays the PID and user of the processes in the host context. periodt.


πŸŽ€ OPTIONS πŸŽ€

  • --help, -h β€” Print usage statement ✨
  • --latest, -l β€” Instead of providing the container name or ID, use the last created container. πŸ“Œ Note: the last started container can be from other users of Podman on the host machine. (This option is not available with the remote Podman client, including Mac and Windows (excluding WSL2) machines)

πŸ’… FORMAT DESCRIPTORS πŸ’…

The following descriptors are supported in addition to the AIX format descriptors mentioned in ps(1):

args, capbnd, capeff, capinh, capprm, comm, etime, group, groups, hgroup, hgroups, hpid, huser, label, nice, pcpu, pgid, pid, ppid, rgroup, ruser, seccomp, state, time, tty, user, vsz


capbnd

Set of bounding capabilities. See capabilities(7) for more information.

capeff

Set of effective capabilities. See capabilities(7) for more information.

capinh

Set of inheritable capabilities. See capabilities(7) for more information.

capprm

Set of permitted capabilities. See capabilities(7) for more information.

group

The effective group of the process.

groups

The supplementary groups of the process.

hgroup

The corresponding effective group of a container process on the host.

hgroups

The corresponding supplementary groups of a container process on the host.

hpid

The corresponding host PID of a container process.

huser

The corresponding effective user of a container process on the host.

label

Current security attributes of the process.

seccomp

Seccomp mode of the process (i.e., disabled, strict or filter). See seccomp(2) for more information.

state

Process state codes (e.g, R for running, S for sleeping). See proc(5) for more information.

stime

Process start time (e.g, "2019-12-09 10:50:36 +0100 CET).


🌈 EXAMPLES 🌈

By default, podman-top prints data similar to ps -ef. bestie behaviour fr fr.

$ podman top f5a62a71b07
USER   PID   PPID   %CPU    ELAPSED         TTY     TIME   COMMAND
root   1     0      0.000   20.386825206s   pts/0   0s     sh
root   7     1      0.000   16.386882887s   pts/0   0s     sleep
root   8     1      0.000   11.386886562s   pts/0   0s     vi

The output can be controlled by specifying format descriptors as arguments after the container. 🧚

$ podman top -l pid seccomp args %C
PID   SECCOMP   COMMAND     %CPU
1     filter    sh          0.000
8     filter    vi /etc/    0.000

Podman falls back to executing ps(1) from the host in the container namespace if an unknown descriptor is specified. (not me finding out the hard way 😭)

$ podman top -l -- aux
USER   PID   PPID   %CPU    ELAPSED             TTY   TIME   COMMAND
root   1     0      0.000   1h2m12.497061672s   ?     0s     sleep 100000

πŸ‘€ SEE ALSO πŸ‘€

podman(1), ps(1), seccomp(2), proc(5), capabilities(7)


πŸ“œ HISTORY πŸ“œ

July 2018, Introduce format descriptors by Valentin Rothberg vrothberg@suse.com ⟨mailto:vrothberg@suse.com⟩

December 2017, Originally compiled by Brent Baude bbaude@redhat.com ⟨mailto:bbaude@redhat.com⟩


and that's the whole vibe, bestie 🫢 this page lives in the podman-top(1) manual, and it's dated the way manpages always are β€” so go forth, run podman top, and slay πŸ’–βœ¨
πŸ“¦ where this page comes from