Docker top 命令

Docker 教程 · 2019-02-18 14:29:11

docker top :查看容器中运行的进程信息,支持 ps 命令参数。

语法

docker top [OPTIONS] CONTAINER [ps OPTIONS]

容器运行时不一定有/bin/bash终端来交互执行top命令,而且容器还不一定有top命令,可以使用docker top来实现查看container中正在运行的进程。

实例

查看容器mymysql的进程信息。

codercto@codercto:~/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

点击查看所有 Docker 教程 文章: https://codercto.com/courses/l/15.html

查看所有标签

Hacking

Hacking

Jon Erickson / No Starch Press / 2008-2-4 / USD 49.95

While other books merely show how to run existing exploits, Hacking: The Art of Exploitation broke ground as the first book to explain how hacking and software exploits work and how readers could deve......一起来看看 《Hacking》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具