LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

docker-top

Display the running processes of a container

TLDR

Show running processes in container
$ docker top [container]
copy
Show with BSD-style ps options (full info)
$ docker top [container] aux
copy
Show with specific columns
$ docker top [container] -o pid,user,comm
copy
Use container ID instead of name
$ docker top [container_id]
copy

SYNOPSIS

docker top CONTAINER [ps OPTIONS]

DESCRIPTION

docker top displays the processes running inside a container by querying the host's process list and filtering for that container's namespace. It is conceptually the same as docker container top and accepts arbitrary ps(1) options to control the output format.The container must be running; stopped containers cannot be inspected with this command. Output reflects the host's view of the processes (host PIDs), not the in-container PIDs.

PARAMETERS

CONTAINER

Name or ID of a running container.
ps OPTIONS
Optional ps(1) flags forwarded to the host's ps to format output (e.g., `aux`, `-eo pid,comm`).

CAVEATS

Process IDs shown are the host's PIDs, not the PIDs as seen from inside the container. The available ps options depend on the host's ps implementation (procps on Linux). Does not work on Windows containers in the same way.

SEE ALSO

Copied to clipboard
Kai