docker top: View Processes in a Container
See the processes running inside a container, from the host.
docker top shows the processes running in a container without needing a shell inside it. This page covers passing ps options and debugging a hung container.
What it does
docker top runs ps on the host scoped to the container processes, so it works even when the image has no ps binary. You can append standard ps options.
Common usage
Terminal
docker top web
docker top web aux
docker top web -eo pid,comm,%cpu,%memCommon errors in CI
"Container ... is not running" - top only works on running containers; for an exited one read docker logs and the exit code via docker inspect. When a CI job hangs, docker top reveals whether the expected process is actually running or stuck, without needing a shell in a minimal image.
Related guides
docker stats: Live Container Resource UsageHow docker stats works: streaming CPU, memory, network, and I/O per container, the --no-stream flag, and spot…
docker exec: Run Commands in a ContainerHow docker exec works: running a command in a running container, opening a shell, env and user flags, and the…
docker inspect: Low-Level Container & Image DetailHow docker inspect works: dumping JSON metadata for containers, images, volumes, and networks, with --format…
docker logs: View Container Logs & Tail in CIHow docker logs works: viewing stdout/stderr from a container, following, tailing, timestamps, and using it t…