docker top

Lists the processes running inside a container, as seen by the Docker daemon.

In more detail

Unlike running ps through docker exec, it works even if the image has no ps command, and it shows host-side process IDs. Extra ps options can be passed after the container name, for example docker top name -o pid,comm.

Example

docker top command-demo

Related terms

Taught in

References