uTools-Manuals/docs/docker/docker top.html
2019-05-07 10:37:34 +08:00

17 lines
850 B
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h1>Docker top 命令</h1>
<p><strong>docker top :</strong>查看容器中运行的进程信息,支持 ps 命令参数。</p>
<h3>语法</h3>
<pre><code class="language-Docker">docker top [OPTIONS] CONTAINER [ps OPTIONS]</code></pre>
<p>容器运行时不一定有/bin/bash终端来交互执行top命令而且容器还不一定有top命令可以使用docker top来实现查看container中正在运行的进程。</p>
<h3>实例</h3>
<p>查看容器mymysql的进程信息。</p>
<pre><code class="language-Docker">runoob@runoob:~/mysql$ docker top mymysql
UID PID PPID C STIME TTY TIME CMD
999 40347 40331 18 00:58 ? 00:00:02 mysqld
</code></pre>
<pre><code class="language-Docker">for i in `docker ps |grep Up|awk '{print $1}'`;do echo \ &amp;&amp;docker top $i; done</code></pre>