diff options
Diffstat (limited to 'devdocs/docker/engine%2Freference%2Fcommandline%2Fnode_ps%2Findex.html')
| -rw-r--r-- | devdocs/docker/engine%2Freference%2Fcommandline%2Fnode_ps%2Findex.html | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/devdocs/docker/engine%2Freference%2Fcommandline%2Fnode_ps%2Findex.html b/devdocs/docker/engine%2Freference%2Fcommandline%2Fnode_ps%2Findex.html new file mode 100644 index 00000000..d410f8d0 --- /dev/null +++ b/devdocs/docker/engine%2Freference%2Fcommandline%2Fnode_ps%2Findex.html @@ -0,0 +1,41 @@ +<h1>docker node ps</h1> <p><br></p> <p>List tasks running on one or more nodes, defaults to current node</p> <p><span class="badge badge-info" data-toggle="tooltip" data-placement="right" title="This command works with the Swarm orchestrator.">Swarm</span> This command works with the Swarm orchestrator.</p> <h2 id="usage">Usage</h2> <div class="highlight"><pre class="highlight" data-language="">$ docker node ps [OPTIONS] [NODE...] +</pre></div> <p>Refer to the <a href="#options">options section</a> for an overview of available <a href="#options"><code class="language-plaintext highlighter-rouge">OPTIONS</code></a> for this command.</p> <h2 id="description">Description</h2> <p name="extended-description">Lists all the tasks on a Node that Docker knows about. You can filter using the <code class="language-plaintext highlighter-rouge">-f</code> or <code class="language-plaintext highlighter-rouge">--filter</code> flag. Refer to the <a href="#filtering">filtering</a> section for more information about available filter options.</p> <blockquote> <p><strong>Note</strong></p> <p>This is a cluster management command, and must be executed on a swarm manager node. To learn about managers and workers, refer to the <a href="../../../swarm/index">Swarm mode section</a> in the documentation.</p> </blockquote> <p>For example uses of this command, refer to the <a href="#examples">examples section</a> below.</p> <h2 id="options">Options</h2> <table> <thead> <tr> <td>Name, shorthand</td> <td>Default</td> <td>Description</td> </tr> </thead> <tbody> <tr> <td> +<code class="language-plaintext highlighter-rouge">--filter</code> , <code class="language-plaintext highlighter-rouge">-f</code> +</td> <td></td> <td>Filter output based on conditions provided</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">--format</code></td> <td></td> <td>Pretty-print tasks using a Go template</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">--no-resolve</code></td> <td></td> <td>Do not map IDs to Names</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">--no-trunc</code></td> <td></td> <td>Do not truncate output</td> </tr> <tr> <td> +<code class="language-plaintext highlighter-rouge">--quiet</code> , <code class="language-plaintext highlighter-rouge">-q</code> +</td> <td></td> <td>Only display task IDs</td> </tr> </tbody> </table> <h2 id="examples">Examples</h2> <div class="highlight"><pre class="highlight" data-language="">$ docker node ps swarm-manager1 + +NAME IMAGE NODE DESIRED STATE CURRENT STATE +redis.1.7q92v0nr1hcgts2amcjyqg3pq redis:3.0.6 swarm-manager1 Running Running 5 hours +redis.6.b465edgho06e318egmgjbqo4o redis:3.0.6 swarm-manager1 Running Running 29 seconds +redis.7.bg8c07zzg87di2mufeq51a2qp redis:3.0.6 swarm-manager1 Running Running 5 seconds +redis.9.dkkual96p4bb3s6b10r7coxxt redis:3.0.6 swarm-manager1 Running Running 5 seconds +redis.10.0tgctg8h8cech4w0k0gwrmr23 redis:3.0.6 swarm-manager1 Running Running 5 seconds +</pre></div> <h3 id="filtering">Filtering</h3> <p>The filtering flag (<code class="language-plaintext highlighter-rouge">-f</code> or <code class="language-plaintext highlighter-rouge">--filter</code>) format is of “key=value”. If there is more than one filter, then pass multiple flags (e.g., <code class="language-plaintext highlighter-rouge">--filter "foo=bar" --filter "bif=baz"</code>)</p> <p>The currently supported filters are:</p> <ul> <li><a href="#name">name</a></li> <li><a href="#id">id</a></li> <li><a href="#label">label</a></li> <li><a href="#desired-state">desired-state</a></li> </ul> <h4 id="name">name</h4> <p>The <code class="language-plaintext highlighter-rouge">name</code> filter matches on all or part of a task’s name.</p> <p>The following filter matches all tasks with a name containing the <code class="language-plaintext highlighter-rouge">redis</code> string.</p> <div class="highlight"><pre class="highlight" data-language="">$ docker node ps -f name=redis swarm-manager1 + +NAME IMAGE NODE DESIRED STATE CURRENT STATE +redis.1.7q92v0nr1hcgts2amcjyqg3pq redis:3.0.6 swarm-manager1 Running Running 5 hours +redis.6.b465edgho06e318egmgjbqo4o redis:3.0.6 swarm-manager1 Running Running 29 seconds +redis.7.bg8c07zzg87di2mufeq51a2qp redis:3.0.6 swarm-manager1 Running Running 5 seconds +redis.9.dkkual96p4bb3s6b10r7coxxt redis:3.0.6 swarm-manager1 Running Running 5 seconds +redis.10.0tgctg8h8cech4w0k0gwrmr23 redis:3.0.6 swarm-manager1 Running Running 5 seconds +</pre></div> <h4 id="id">id</h4> <p>The <code class="language-plaintext highlighter-rouge">id</code> filter matches a task’s id.</p> <div class="highlight"><pre class="highlight" data-language="">$ docker node ps -f id=bg8c07zzg87di2mufeq51a2qp swarm-manager1 + +NAME IMAGE NODE DESIRED STATE CURRENT STATE +redis.7.bg8c07zzg87di2mufeq51a2qp redis:3.0.6 swarm-manager1 Running Running 5 seconds +</pre></div> <h4 id="label">label</h4> <p>The <code class="language-plaintext highlighter-rouge">label</code> filter matches tasks based on the presence of a <code class="language-plaintext highlighter-rouge">label</code> alone or a <code class="language-plaintext highlighter-rouge">label</code> and a value.</p> <p>The following filter matches tasks with the <code class="language-plaintext highlighter-rouge">usage</code> label regardless of its value.</p> <div class="highlight"><pre class="highlight" data-language="">$ docker node ps -f "label=usage" + +NAME IMAGE NODE DESIRED STATE CURRENT STATE +redis.6.b465edgho06e318egmgjbqo4o redis:3.0.6 swarm-manager1 Running Running 10 minutes +redis.7.bg8c07zzg87di2mufeq51a2qp redis:3.0.6 swarm-manager1 Running Running 9 minutes +</pre></div> <h4 id="desired-state">desired-state</h4> <p>The <code class="language-plaintext highlighter-rouge">desired-state</code> filter can take the values <code class="language-plaintext highlighter-rouge">running</code>, <code class="language-plaintext highlighter-rouge">shutdown</code>, or <code class="language-plaintext highlighter-rouge">accepted</code>.</p> <h3 id="formatting">Formatting</h3> <p>The formatting options (<code class="language-plaintext highlighter-rouge">--format</code>) pretty-prints tasks output using a Go template.</p> <p>Valid placeholders for the Go template are listed below:</p> <table> <thead> <tr> <th>Placeholder</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><code class="language-plaintext highlighter-rouge">.ID</code></td> <td>Task ID</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">.Name</code></td> <td>Task name</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">.Image</code></td> <td>Task image</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">.Node</code></td> <td>Node ID</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">.DesiredState</code></td> <td>Desired state of the task (<code class="language-plaintext highlighter-rouge">running</code>, <code class="language-plaintext highlighter-rouge">shutdown</code>, or <code class="language-plaintext highlighter-rouge">accepted</code>)</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">.CurrentState</code></td> <td>Current state of the task</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">.Error</code></td> <td>Error</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">.Ports</code></td> <td>Task published ports</td> </tr> </tbody> </table> <p>When using the <code class="language-plaintext highlighter-rouge">--format</code> option, the <code class="language-plaintext highlighter-rouge">node ps</code> command will either output the data exactly as the template declares or, when using the <code class="language-plaintext highlighter-rouge">table</code> directive, includes column headers as well.</p> <p>The following example uses a template without headers and outputs the <code class="language-plaintext highlighter-rouge">Name</code> and <code class="language-plaintext highlighter-rouge">Image</code> entries separated by a colon (<code class="language-plaintext highlighter-rouge">:</code>) for all tasks:</p> <div class="highlight"><pre class="highlight" data-language="">$ docker node ps --format "{{.Name}}: {{.Image}}" + +top.1: busybox +top.2: busybox +top.3: busybox +</pre></div> <h2 id="parent-command">Parent command</h2> <table> <thead> <tr> <th style="text-align: left">Command</th> <th style="text-align: left">Description</th> </tr> </thead> <tbody> <tr> <td style="text-align: left"><a href="../node/index">docker node</a></td> <td style="text-align: left">Manage Swarm nodes</td> </tr> </tbody> </table> <h2 id="related-commands">Related commands</h2> <table> <thead> <tr> <td>Command</td> <td>Description</td> </tr> </thead> <tbody> <tr> <td><a href="../node_demote/index">docker node demote</a></td> <td>Demote one or more nodes from manager in the swarm</td> </tr> <tr> <td><a href="../node_inspect/index">docker node inspect</a></td> <td>Display detailed information on one or more nodes</td> </tr> <tr> <td><a href="../node_ls/index">docker node ls</a></td> <td>List nodes in the swarm</td> </tr> <tr> <td><a href="../node_promote/index">docker node promote</a></td> <td>Promote one or more nodes to manager in the swarm</td> </tr> <tr> <td><a href="index">docker node ps</a></td> <td>List tasks running on one or more nodes, defaults to current node</td> </tr> <tr> <td><a href="../node_rm/index">docker node rm</a></td> <td>Remove one or more nodes from the swarm</td> </tr> <tr> <td><a href="../node_update/index">docker node update</a></td> <td>Update a node</td> </tr> </tbody> </table> <div class="_attribution"> + <p class="_attribution-p"> + © 2019 Docker, Inc.<br>Licensed under the Apache License, Version 2.0.<br>Docker and the Docker logo are trademarks or registered trademarks of Docker, Inc. in the United States and/or other countries.<br>Docker, Inc. and other parties may also have trademark rights in other terms used herein.<br> + <a href="https://docs.docker.com/engine/reference/commandline/node_ps/" class="_attribution-link">https://docs.docker.com/engine/reference/commandline/node_ps/</a> + </p> +</div> |
