1.docker top介绍

docker top命令是用来查看docker容器中运行的进程信息

2.docker top用法

docker top [参数] container [container......]

[root@centos79 ~]# docker top --help

Usage:  docker top CONTAINER [ps OPTIONS]

Display the running processes of a container

Aliases:
  docker container top, docker top
[root@centos79 ~]#

3.实例

3.1.查看容器中进程信息

命令:

docker top centos-nginx

[root@centos79 ~]# docker ps -a | grep centos-nginx
425747b4385b   centos-nginx:1.0       "nginx -g 'daemon of…"   9 hours ago   Up About an hour           0.0.0.0:80->80/tcp, :::80->80/tcp                                                      centos-nginx
[root@centos79 ~]# docker top centos-nginx
UID                 PID                 PPID                C                   STIME               TTY                 TIME                CMD
root                2184                2108                0                   17:56               ?                   00:00:00            nginx: master process nginx -g daemon off;
zhangte+            2491                2184                0                   17:56               ?                   00:00:00            nginx: worker process
[root@centos79 ~]#