Manage Docker stacks The client and daemon API must both be at least 1.25 to use this command. Use the docker version command on the client to check your client and daemon API versions. Manage stacks.
Deploy a new stack or update an existing stack The client and daemon API must both be at least 1.25 to use this command. Use the docker version command on the client to check your client and daemon API versions. Create and update a stack from a compose file on the swarm.
These topics describe the Docker Compose implementation of the Compose format. Docker Compose 1.27.0+ implements the format defined by the Compose Specification. Previous Docker Compose versions have support for several Compose file formats – 1, 2, 2.x, and 3.x. The Compose specification is an unified 2.x and 3.x file format, aggregating properties accross these formats.
This document specifies the Compose file format used to define multi-containers applications. Distribution of this document is unlimited. The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119.
List stacks The client and daemon API must both be at least 1.25 to use this command. Use the docker version command on the client to check your client and daemon API versions. Lists the stacks. Note This is a cluster management command, and must be executed on a swarm manager node.
List stacks
Stack一覧を表示する。
$ docker stack ls
NAME SERVICES ORCHESTRATOR
webapp 2 Swarm
–format
出力をフォーマットする。
Placeholder
Description
.Name
Stack name
.Services
Number of services
.Orchestrator
Orchestrator name
.Namespace
Namespace
$ docker stack ls --format "{{.Name}}: {{.Services}}"
webapp: 2
List the tasks in the stack The client and daemon API must both be at least 1.25 to use this command. Use the docker version command on the client to check your client and daemon API versions. Lists the tasks that are running as part of the specified stack.
List the tasks in the stack
StackのTask一覧を表示する。
$ docker stack ps [stack-name]
–filter, -f
フィルタリングして表示する。
Expression
Supported
id==xxxx
Swarm / Kubernetes
name=xxxx
Swarm / Kubernetes
node=xxxx
Swarm / Kubernetes
desired-state=xxxx
Swarm / Kubernetes
$ docker stack ps [stack-name] -f "name=web"
–format
出力をフォーマットする。
Placeholder
Description
.ID
Task ID
.Name
Task name
.Image
Task image
.Node
Node ID
.DesiredState
Desired state of the task (running, shutdown, or accepted)
Remove one or more stacks The client and daemon API must both be at least 1.25 to use this command. Use the docker version command on the client to check your client and daemon API versions. Remove the stack from the swarm. Note This is a cluster management command, and must be executed on a swarm manager node.
List the services in the stack The client and daemon API must both be at least 1.25 to use this command. Use the docker version command on the client to check your client and daemon API versions. Lists the services that are running as part of the specified stack.