github.com/pwn-term/docker@v0.0.0-20210616085119-6e977cce2565/cli/docs/reference/commandline/stack_deploy.md (about)

     1  ---
     2  title: "stack deploy"
     3  description: "The stack deploy command description and usage"
     4  keywords: "stack, deploy, up"
     5  ---
     6  
     7  # stack deploy
     8  
     9  ```markdown
    10  Usage:  docker stack deploy [OPTIONS] STACK
    11  
    12  Deploy a new stack or update an existing stack
    13  
    14  Aliases:
    15    deploy, up
    16  
    17  Options:
    18    -c, --compose-file strings  Path to a Compose file, or "-" to read from stdin
    19        --help                  Print usage
    20        --kubeconfig string     Kubernetes config file
    21        --namespace string      Kubernetes namespace to use
    22        --orchestrator string   Orchestrator to use (swarm|kubernetes|all)
    23        --prune                 Prune services that are no longer referenced
    24        --resolve-image string  Query the registry to resolve image digest and supported platforms
    25                                ("always"|"changed"|"never") (default "always")
    26        --with-registry-auth    Send registry authentication details to Swarm agents
    27  ```
    28  
    29  ## Description
    30  
    31  Create and update a stack from a `compose` file on the swarm.
    32  
    33  > **Note**
    34  >
    35  > This is a cluster management command, and must be executed on a swarm
    36  > manager node. To learn about managers and workers, refer to the
    37  > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the
    38  > documentation.
    39  
    40  ## Examples
    41  
    42  ### Compose file
    43  
    44  The `deploy` command supports compose file version `3.0` and above.
    45  
    46  ```bash
    47  $ docker stack deploy --compose-file docker-compose.yml vossibility
    48  
    49  Ignoring unsupported options: links
    50  
    51  Creating network vossibility_vossibility
    52  Creating network vossibility_default
    53  Creating service vossibility_nsqd
    54  Creating service vossibility_logstash
    55  Creating service vossibility_elasticsearch
    56  Creating service vossibility_kibana
    57  Creating service vossibility_ghollector
    58  Creating service vossibility_lookupd
    59  ```
    60  
    61  The Compose file can also be provided as standard input with `--compose-file -`:
    62  
    63  ```bash
    64  $ cat docker-compose.yml | docker stack deploy --compose-file - vossibility
    65  
    66  Ignoring unsupported options: links
    67  
    68  Creating network vossibility_vossibility
    69  Creating network vossibility_default
    70  Creating service vossibility_nsqd
    71  Creating service vossibility_logstash
    72  Creating service vossibility_elasticsearch
    73  Creating service vossibility_kibana
    74  Creating service vossibility_ghollector
    75  Creating service vossibility_lookupd
    76  ```
    77  
    78  If your configuration is split between multiple Compose files, e.g. a base
    79  configuration and environment-specific overrides, you can provide multiple
    80  `--compose-file` flags.
    81  
    82  ```bash
    83  $ docker stack deploy --compose-file docker-compose.yml -c docker-compose.prod.yml vossibility
    84  
    85  Ignoring unsupported options: links
    86  
    87  Creating network vossibility_vossibility
    88  Creating network vossibility_default
    89  Creating service vossibility_nsqd
    90  Creating service vossibility_logstash
    91  Creating service vossibility_elasticsearch
    92  Creating service vossibility_kibana
    93  Creating service vossibility_ghollector
    94  Creating service vossibility_lookupd
    95  ```
    96  
    97  You can verify that the services were correctly created:
    98  
    99  ```bash
   100  $ docker service ls
   101  
   102  ID            NAME                               MODE        REPLICAS  IMAGE
   103  29bv0vnlm903  vossibility_lookupd                replicated  1/1       nsqio/nsq@sha256:eeba05599f31eba418e96e71e0984c3dc96963ceb66924dd37a47bf7ce18a662
   104  4awt47624qwh  vossibility_nsqd                   replicated  1/1       nsqio/nsq@sha256:eeba05599f31eba418e96e71e0984c3dc96963ceb66924dd37a47bf7ce18a662
   105  4tjx9biia6fs  vossibility_elasticsearch          replicated  1/1       elasticsearch@sha256:12ac7c6af55d001f71800b83ba91a04f716e58d82e748fa6e5a7359eed2301aa
   106  7563uuzr9eys  vossibility_kibana                 replicated  1/1       kibana@sha256:6995a2d25709a62694a937b8a529ff36da92ebee74bafd7bf00e6caf6db2eb03
   107  9gc5m4met4he  vossibility_logstash               replicated  1/1       logstash@sha256:2dc8bddd1bb4a5a34e8ebaf73749f6413c101b2edef6617f2f7713926d2141fe
   108  axqh55ipl40h  vossibility_vossibility-collector  replicated  1/1       icecrime/vossibility-collector@sha256:f03f2977203ba6253988c18d04061c5ec7aab46bca9dfd89a9a1fa4500989fba
   109  ```
   110  
   111  ## Related commands
   112  
   113  * [stack ls](stack_ls.md)
   114  * [stack ps](stack_ps.md)
   115  * [stack rm](stack_rm.md)
   116  * [stack services](stack_services.md)