inspection

docker top

Displays the running processes inside a container, similar to running ps on the host restricted to that container's PID namespace. Accepts standard ps flags after the container name.

docker top CONTAINER [ps OPTIONS]

Common flags

Flag Purpose
aux ps(1) argument passed through — BSD-style, shows all users + processes
-ef ps(1) argument passed through — full listing with parent PID
-o pid,cmd ps(1) argument passed through — custom column selection

Examples

docker top web

Default process list for the web container

docker top web aux

BSD ps-style detailed output

docker top db -eo pid,user,cmd

Custom columns

docker top worker -ef

System V ps format

Gotcha

docker top has no flags of its own — anything after the container name is passed straight to `ps(1)` inside the container namespace. Different distros' ps behave differently.

Related commands

← All Docker commands · Docker vs Kubernetes · Docker vs VMs