May 2017
Beginner
300 pages
7h 26m
English
You can run the top command from the Docker host machine using the following command:
docker top [OPTIONS] CONTAINER [ps OPTIONS]
This gives a list of the running processes of a container without logging in to the container, as follows:
$ sudo docker top a245253db38bUID PID PPID CSTIME TTY TIME CMDroot 5232 3585 0Mar22 ? 00:00:53 python app.py $ sudo docker top a245253db38b -aefUID PID PPID CSTIME TTY TIME CMDroot 5232 3585 0Mar22 ? 00:00:53 python app.py
The Docker top command provides information about the CPU, memory, and swap usage if you run it inside a Docker container:
root@a245253db38b:/opt/webapp# toptop - 19:35:03 up 25 days, 15:50, 0 users, load average: 0.00, 0.01, 0.05Tasks: 3 total, 1 running, 2 sleeping, ...
Read now
Unlock full access