Docker top Command

Docker top Command

docker top : View information about the processes running in the container, supports the ps command parameter.

Docker top Syntax

docker top [OPTIONS] CONTAINER [ps OPTIONS]

Containers do not necessarily have a /bin/bash terminal to interactively execute the top command when they are running, and containers do not necessarily have the top command yet, so you can use docker top to implement to see the running processes in the container.

Docker top Examples

View the process information of container mymysql.

apidemos@apidemos:~/mysql$ docker top mymysql
UID    PID    PPID    C      STIME   TTY  TIME       CMD
999    40347  40331   18     00:58   ?    00:00:02   mysqld

View information about all processes running the container.

for i in  `docker ps |grep Up|awk '{print 1}'`;do echo \ &&docker topi; done
Like(0)