From 754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 7 Apr 2024 13:41:34 -0500 Subject: new repository --- ...nce%2Fcommandline%2Fstack_services%2Findex.html | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 devdocs/docker/engine%2Freference%2Fcommandline%2Fstack_services%2Findex.html (limited to 'devdocs/docker/engine%2Freference%2Fcommandline%2Fstack_services%2Findex.html') 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 @@ +

docker stack services


List the services in the stack

Usage

$ docker stack services [OPTIONS] STACK
+

Refer to the options section for an overview of available OPTIONS for this command.

Description

Lists the services that are running as part of the specified stack.

Note

This is a cluster management command, and must be executed on a swarm manager node. To learn about managers and workers, refer to the Swarm mode section in the documentation.

For example uses of this command, refer to the examples section below.

Options

Name, shorthand Default Description
+--filter , -f + Filter output based on conditions provided
--format Pretty-print services using a Go template
--namespace +deprecatedKubernetes
Kubernetes namespace to use
+--quiet , -q + Only display IDs
--kubeconfig +deprecatedKubernetes
Kubernetes config file
--orchestrator +deprecated
Orchestrator to use (swarm|kubernetes|all)

Examples

The following command shows all services in the myapp stack:

$ 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
+

Filtering

The filtering flag (-f or --filter) format is a key=value pair. If there is more than one filter, then pass multiple flags (e.g. --filter "foo=bar" --filter "bif=baz"). Multiple filter flags are combined as an OR filter.

The following command shows both the web and db services:

$ 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
+

The currently supported filters are:

Formatting

The formatting options (--format) pretty-prints services output using a Go template.

Valid placeholders for the Go template are listed below:

Placeholder Description
.ID Service ID
.Name Service name
.Mode Service mode (replicated, global)
.Replicas Service replicas
.Image Service image

When using the --format option, the stack services command will either output the data exactly as the template declares or, when using the table directive, includes column headers as well.

The following example uses a template without headers and outputs the ID, Mode, and Replicas entries separated by a colon (:) for all services:

$ docker stack services --format "{{.ID}}: {{.Mode}} {{.Replicas}}"
+
+0zmvwuiu3vue: replicated 10/10
+fm6uf97exkul: global 5/5
+

Parent command

Command Description
docker stack Manage Docker stacks
Command Description
docker stack deploy Deploy a new stack or update an existing stack
docker stack ls List stacks
docker stack ps List the tasks in the stack
docker stack rm Remove one or more stacks
docker stack services List the services in the stack
+

+ © 2019 Docker, Inc.
Licensed under the Apache License, Version 2.0.
Docker and the Docker logo are trademarks or registered trademarks of Docker, Inc. in the United States and/or other countries.
Docker, Inc. and other parties may also have trademark rights in other terms used herein.
+ https://docs.docker.com/engine/reference/commandline/stack_services/ +

+
-- cgit v1.2.3