Docker Monitoring processes in a container


Inspecting system resource usage is an efficient way to narrow down a problem on a live running application. This example is an equivalent of the traditional ps command for containers.

docker top 7786807d8084

To filter of format the output, add ps options on the command line:

docker top 7786807d8084 faux

Or, to get the list of processes running as root, which is a potentially harmful practice:

docker top 7786807d8084 -u root

The docker top command proves especially useful when troubleshooting minimalistic containers without a shell or the ps command.