github.com/sld880311/docker@v0.0.0-20200524143708-d5593973a475/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  <!-- This file is maintained within the docker/docker Github
     8       repository at https://github.com/docker/docker/. Make all
     9       pull requests against that repo. If you see this file in
    10       another repository, consider it read-only there, as it will
    11       periodically be overwritten by the definitive file. Pull
    12       requests which include edits to this file in other repositories
    13       will be rejected.
    14  -->
    15  
    16  # stack deploy
    17  
    18  ```markdown
    19  Usage:  docker stack deploy [OPTIONS] STACK
    20  
    21  Deploy a new stack or update an existing stack
    22  
    23  Aliases:
    24    deploy, up
    25  
    26  Options:
    27        --bundle-file string    Path to a Distributed Application Bundle file
    28    -c, --compose-file string   Path to a Compose file
    29        --help                  Print usage
    30        --with-registry-auth    Send registry authentication details to Swarm agents
    31  ```
    32  
    33  ## Description
    34  
    35  Create and update a stack from a `compose` or a `dab` file on the swarm. This command
    36  has to be run targeting a manager node.
    37  
    38  ## Examples
    39  
    40  ### Compose file
    41  
    42  The `deploy` command supports compose file version `3.0` and above."
    43  
    44  ```bash
    45  $ docker stack deploy --compose-file docker-compose.yml vossibility
    46  
    47  Ignoring unsupported options: links
    48  
    49  Creating network vossibility_vossibility
    50  Creating network vossibility_default
    51  Creating service vossibility_nsqd
    52  Creating service vossibility_logstash
    53  Creating service vossibility_elasticsearch
    54  Creating service vossibility_kibana
    55  Creating service vossibility_ghollector
    56  Creating service vossibility_lookupd
    57  ```
    58  
    59  You can verify that the services were correctly created
    60  
    61  ```bash
    62  $ docker service ls
    63  
    64  ID            NAME                               MODE        REPLICAS  IMAGE
    65  29bv0vnlm903  vossibility_lookupd                replicated  1/1       nsqio/nsq@sha256:eeba05599f31eba418e96e71e0984c3dc96963ceb66924dd37a47bf7ce18a662
    66  4awt47624qwh  vossibility_nsqd                   replicated  1/1       nsqio/nsq@sha256:eeba05599f31eba418e96e71e0984c3dc96963ceb66924dd37a47bf7ce18a662
    67  4tjx9biia6fs  vossibility_elasticsearch          replicated  1/1       elasticsearch@sha256:12ac7c6af55d001f71800b83ba91a04f716e58d82e748fa6e5a7359eed2301aa
    68  7563uuzr9eys  vossibility_kibana                 replicated  1/1       kibana@sha256:6995a2d25709a62694a937b8a529ff36da92ebee74bafd7bf00e6caf6db2eb03
    69  9gc5m4met4he  vossibility_logstash               replicated  1/1       logstash@sha256:2dc8bddd1bb4a5a34e8ebaf73749f6413c101b2edef6617f2f7713926d2141fe
    70  axqh55ipl40h  vossibility_vossibility-collector  replicated  1/1       icecrime/vossibility-collector@sha256:f03f2977203ba6253988c18d04061c5ec7aab46bca9dfd89a9a1fa4500989fba
    71  ```
    72  
    73  ### DAB file
    74  
    75  ```bash
    76  $ docker stack deploy --bundle-file vossibility-stack.dab vossibility
    77  
    78  Loading bundle from vossibility-stack.dab
    79  Creating service vossibility_elasticsearch
    80  Creating service vossibility_kibana
    81  Creating service vossibility_logstash
    82  Creating service vossibility_lookupd
    83  Creating service vossibility_nsqd
    84  Creating service vossibility_vossibility-collector
    85  ```
    86  
    87  You can verify that the services were correctly created:
    88  
    89  ```bash
    90  $ docker service ls
    91  
    92  ID            NAME                               MODE        REPLICAS  IMAGE
    93  29bv0vnlm903  vossibility_lookupd                replicated  1/1       nsqio/nsq@sha256:eeba05599f31eba418e96e71e0984c3dc96963ceb66924dd37a47bf7ce18a662
    94  4awt47624qwh  vossibility_nsqd                   replicated  1/1       nsqio/nsq@sha256:eeba05599f31eba418e96e71e0984c3dc96963ceb66924dd37a47bf7ce18a662
    95  4tjx9biia6fs  vossibility_elasticsearch          replicated  1/1       elasticsearch@sha256:12ac7c6af55d001f71800b83ba91a04f716e58d82e748fa6e5a7359eed2301aa
    96  7563uuzr9eys  vossibility_kibana                 replicated  1/1       kibana@sha256:6995a2d25709a62694a937b8a529ff36da92ebee74bafd7bf00e6caf6db2eb03
    97  9gc5m4met4he  vossibility_logstash               replicated  1/1       logstash@sha256:2dc8bddd1bb4a5a34e8ebaf73749f6413c101b2edef6617f2f7713926d2141fe
    98  axqh55ipl40h  vossibility_vossibility-collector  replicated  1/1       icecrime/vossibility-collector@sha256:f03f2977203ba6253988c18d04061c5ec7aab46bca9dfd89a9a1fa4500989fba
    99  ```
   100  
   101  ## Related commands
   102  
   103  * [stack ls](stack_ls.md)
   104  * [stack ps](stack_ps.md)
   105  * [stack rm](stack_rm.md)
   106  * [stack services](stack_services.md)