Skip to content

Latest commit

History

History
111 lines (82 loc) · 4.89 KB

File metadata and controls

111 lines (82 loc) · 4.89 KB

stack deploy

Deploy a new stack or update an existing stack

Aliases

docker stack deploy, docker stack up

Options

NameTypeDefaultDescription
-c, --compose-filestringSlicePath to a Compose file, or - to read from stdin
-d, --detachbooltrueExit immediately instead of waiting for the stack services to converge
--pruneboolPrune services that are no longer referenced
-q, --quietboolSuppress progress output
--resolve-imagestringalwaysQuery the registry to resolve image digest and supported platforms (always, changed, never)
--with-registry-authboolSend registry authentication details to Swarm agents

Description

Create and update a stack from a compose file on the swarm.

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.

Examples

Compose file (--compose-file)

The deploy command supports Compose file version 3.0 and above.

$ docker stack deploy --compose-file docker-compose.yml vossibilityIgnoring unsupported options: linksCreating network vossibility_vossibilityCreating network vossibility_defaultCreating service vossibility_nsqdCreating service vossibility_logstashCreating service vossibility_elasticsearchCreating service vossibility_kibanaCreating service vossibility_ghollectorCreating service vossibility_lookupd

The Compose file can also be provided as standard input with --compose-file -:

$ cat docker-compose.yml | docker stack deploy --compose-file - vossibilityIgnoring unsupported options: linksCreating network vossibility_vossibilityCreating network vossibility_defaultCreating service vossibility_nsqdCreating service vossibility_logstashCreating service vossibility_elasticsearchCreating service vossibility_kibanaCreating service vossibility_ghollectorCreating service vossibility_lookupd

If your configuration is split between multiple Compose files, e.g. a base configuration and environment-specific overrides, you can provide multiple --compose-file flags.

$ docker stack deploy --compose-file docker-compose.yml -c docker-compose.prod.yml vossibilityIgnoring unsupported options: linksCreating network vossibility_vossibilityCreating network vossibility_defaultCreating service vossibility_nsqdCreating service vossibility_logstashCreating service vossibility_elasticsearchCreating service vossibility_kibanaCreating service vossibility_ghollectorCreating service vossibility_lookupd

You can verify that the services were correctly created:

$ docker service lsID NAME MODE REPLICAS IMAGE29bv0vnlm903 vossibility_lookupd replicated 1/1 nsqio/nsq@sha256:eeba05599f31eba418e96e71e0984c3dc96963ceb66924dd37a47bf7ce18a6624awt47624qwh vossibility_nsqd replicated 1/1 nsqio/nsq@sha256:eeba05599f31eba418e96e71e0984c3dc96963ceb66924dd37a47bf7ce18a6624tjx9biia6fs vossibility_elasticsearch replicated 1/1 elasticsearch@sha256:12ac7c6af55d001f71800b83ba91a04f716e58d82e748fa6e5a7359eed2301aa7563uuzr9eys vossibility_kibana replicated 1/1 kibana@sha256:6995a2d25709a62694a937b8a529ff36da92ebee74bafd7bf00e6caf6db2eb039gc5m4met4he vossibility_logstash replicated 1/1 logstash@sha256:2dc8bddd1bb4a5a34e8ebaf73749f6413c101b2edef6617f2f7713926d2141feaxqh55ipl40h vossibility_vossibility-collector replicated 1/1 icecrime/vossibility-collector@sha256:f03f2977203ba6253988c18d04061c5ec7aab46bca9dfd89a9a1fa4500989fba

Related commands