docker top : View the process information running in the container and support ps command parameters. The container runtime does not necessarily have / bin/bash terminals to interactively execute top commands, and the container does not necessarily have top commands, so you can use docker top to view the running processes in the container. View the process information of the container mymysql. View the process information for all running containers. 2.39.1. Grammar ¶
docker top [OPTIONS] CONTAINER [ps OPTIONS]
2.39.2. Example ¶
runoob@runoob:~/mysql$ docker top mymysql
UID PID PPID C STIME TTY TIME CMD
999 40347 40331 18 00:58 ? 00:00:02 mysqld
for i in `docker ps |grep Up|awk '{print $1}'`;do echo &&docker top $i; done