diff options
| author | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2024-04-07 13:41:34 -0500 |
| commit | 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch) | |
| tree | f1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/docker/engine%2Freference%2Fcommandline%2Fstack_services%2Findex.html | |
new repository
Diffstat (limited to 'devdocs/docker/engine%2Freference%2Fcommandline%2Fstack_services%2Findex.html')
| -rw-r--r-- | devdocs/docker/engine%2Freference%2Fcommandline%2Fstack_services%2Findex.html | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/devdocs/docker/engine%2Freference%2Fcommandline%2Fstack_services%2Findex.html b/devdocs/docker/engine%2Freference%2Fcommandline%2Fstack_services%2Findex.html new file mode 100644 index 00000000..94548d88 --- /dev/null +++ b/devdocs/docker/engine%2Freference%2Fcommandline%2Fstack_services%2Findex.html @@ -0,0 +1,28 @@ +<h1>docker stack services</h1> <p><br></p> <p>List the services in the stack</p> <h2 id="usage">Usage</h2> <div class="highlight"><pre class="highlight" data-language="">$ docker stack services [OPTIONS] STACK +</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 the services that are running as part of the specified stack.</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 services using a Go template</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">--namespace</code></td> <td></td> <td> +<a href="../../../deprecated/index" target="_blank" rel="noopener" class="_"><span class="badge badge-danger" data-toggle="tooltip" title="Read the deprecation reference (in a new window).">deprecated</span></a><span class="badge badge-info" data-toggle="tooltip" title="This option works for the Kubernetes orchestrator.">Kubernetes</span><br>Kubernetes namespace to use</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 IDs</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">--kubeconfig</code></td> <td></td> <td> +<a href="../../../deprecated/index" target="_blank" rel="noopener" class="_"><span class="badge badge-danger" data-toggle="tooltip" title="Read the deprecation reference (in a new window).">deprecated</span></a><span class="badge badge-info" data-toggle="tooltip" title="This option works for the Kubernetes orchestrator.">Kubernetes</span><br>Kubernetes config file</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">--orchestrator</code></td> <td></td> <td> +<a href="../../../deprecated/index" target="_blank" rel="noopener" class="_"><span class="badge badge-danger" data-toggle="tooltip" title="Read the deprecation reference (in a new window).">deprecated</span></a><br>Orchestrator to use (swarm|kubernetes|all)</td> </tr> </tbody> </table> <h2 id="examples">Examples</h2> <p>The following command shows all services in the <code class="language-plaintext highlighter-rouge">myapp</code> stack:</p> <div class="highlight"><pre class="highlight" data-language="">$ docker stack services myapp + +ID NAME REPLICAS IMAGE COMMAND +7be5ei6sqeye myapp_web 1/1 nginx@sha256:23f809e7fd5952e7d5be065b4d3643fbbceccd349d537b62a123ef2201bc886f +dn7m7nhhfb9y myapp_db 1/1 mysql@sha256:a9a5b559f8821fe73d58c3606c812d1c044868d42c63817fa5125fd9d8b7b539 +</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 a <code class="language-plaintext highlighter-rouge">key=value</code> pair. 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>). Multiple filter flags are combined as an <code class="language-plaintext highlighter-rouge">OR</code> filter.</p> <p>The following command shows both the <code class="language-plaintext highlighter-rouge">web</code> and <code class="language-plaintext highlighter-rouge">db</code> services:</p> <div class="highlight"><pre class="highlight" data-language="">$ docker stack services --filter name=myapp_web --filter name=myapp_db myapp + +ID NAME REPLICAS IMAGE COMMAND +7be5ei6sqeye myapp_web 1/1 nginx@sha256:23f809e7fd5952e7d5be065b4d3643fbbceccd349d537b62a123ef2201bc886f +dn7m7nhhfb9y myapp_db 1/1 mysql@sha256:a9a5b559f8821fe73d58c3606c812d1c044868d42c63817fa5125fd9d8b7b539 +</pre></div> <p>The currently supported filters are:</p> <ul> <li>id / ID (<code class="language-plaintext highlighter-rouge">--filter id=7be5ei6sqeye</code>, or <code class="language-plaintext highlighter-rouge">--filter ID=7be5ei6sqeye</code>) <ul> <li>Swarm: supported</li> <li>Kubernetes: not supported</li> </ul> </li> <li>label (<code class="language-plaintext highlighter-rouge">--filter label=key=value</code>) <ul> <li>Swarm: supported</li> <li>Kubernetes: supported</li> </ul> </li> <li>mode (<code class="language-plaintext highlighter-rouge">--filter mode=replicated</code>, or <code class="language-plaintext highlighter-rouge">--filter mode=global</code>) <ul> <li>Swarm: not supported</li> <li>Kubernetes: supported</li> </ul> </li> <li>name (<code class="language-plaintext highlighter-rouge">--filter name=myapp_web</code>) <ul> <li>Swarm: supported</li> <li>Kubernetes: supported</li> </ul> </li> <li>node (<code class="language-plaintext highlighter-rouge">--filter node=mynode</code>) <ul> <li>Swarm: not supported</li> <li>Kubernetes: supported</li> </ul> </li> <li>service (<code class="language-plaintext highlighter-rouge">--filter service=web</code>) <ul> <li>Swarm: not supported</li> <li>Kubernetes: supported</li> </ul> </li> </ul> <h3 id="formatting">Formatting</h3> <p>The formatting options (<code class="language-plaintext highlighter-rouge">--format</code>) pretty-prints services 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>Service ID</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">.Name</code></td> <td>Service name</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">.Mode</code></td> <td>Service mode (replicated, global)</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">.Replicas</code></td> <td>Service replicas</td> </tr> <tr> <td><code class="language-plaintext highlighter-rouge">.Image</code></td> <td>Service image</td> </tr> </tbody> </table> <p>When using the <code class="language-plaintext highlighter-rouge">--format</code> option, the <code class="language-plaintext highlighter-rouge">stack services</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">ID</code>, <code class="language-plaintext highlighter-rouge">Mode</code>, and <code class="language-plaintext highlighter-rouge">Replicas</code> entries separated by a colon (<code class="language-plaintext highlighter-rouge">:</code>) for all services:</p> <div class="highlight"><pre class="highlight" data-language="">$ docker stack services --format "{{.ID}}: {{.Mode}} {{.Replicas}}" + +0zmvwuiu3vue: replicated 10/10 +fm6uf97exkul: global 5/5 +</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="../stack/index">docker stack</a></td> <td style="text-align: left">Manage Docker stacks</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="../stack_deploy/index">docker stack deploy</a></td> <td>Deploy a new stack or update an existing stack</td> </tr> <tr> <td><a href="../stack_ls/index">docker stack ls</a></td> <td>List stacks</td> </tr> <tr> <td><a href="../stack_ps/index">docker stack ps</a></td> <td>List the tasks in the stack</td> </tr> <tr> <td><a href="../stack_rm/index">docker stack rm</a></td> <td>Remove one or more stacks</td> </tr> <tr> <td><a href="index">docker stack services</a></td> <td>List the services in the stack</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/stack_services/" class="_attribution-link">https://docs.docker.com/engine/reference/commandline/stack_services/</a> + </p> +</div> |
