github.com/jiasir/docker@v1.3.3-0.20170609024000-252e610103e7/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        --prune                 Prune services that are no longer referenced
    31        --with-registry-auth    Send registry authentication details to Swarm agents
    32  ```
    33  
    34  ## Description
    35  
    36  Create and update a stack from a `compose` or a `dab` file on the swarm. This command
    37  has to be run targeting a manager node.
    38  
    39  ## Examples
    40  
    41  ### Compose file
    42  
    43  The `deploy` command supports compose file version `3.0` and above."
    44  
    45  ```bash
    46  $ docker stack deploy --compose-file docker-compose.yml vossibility
    47  
    48  Ignoring unsupported options: links
    49  
    50  Creating network vossibility_vossibility
    51  Creating network vossibility_default
    52  Creating service vossibility_nsqd
    53  Creating service vossibility_logstash
    54  Creating service vossibility_elasticsearch
    55  Creating service vossibility_kibana
    56  Creating service vossibility_ghollector
    57  Creating service vossibility_lookupd
    58  ```
    59  
    60  You can verify that the services were correctly created
    61  
    62  ```bash
    63  $ docker service ls
    64  
    65  ID            NAME                               MODE        REPLICAS  IMAGE
    66  29bv0vnlm903  vossibility_lookupd                replicated  1/1       nsqio/nsq@sha256:eeba05599f31eba418e96e71e0984c3dc96963ceb66924dd37a47bf7ce18a662
    67  4awt47624qwh  vossibility_nsqd                   replicated  1/1       nsqio/nsq@sha256:eeba05599f31eba418e96e71e0984c3dc96963ceb66924dd37a47bf7ce18a662
    68  4tjx9biia6fs  vossibility_elasticsearch          replicated  1/1       elasticsearch@sha256:12ac7c6af55d001f71800b83ba91a04f716e58d82e748fa6e5a7359eed2301aa
    69  7563uuzr9eys  vossibility_kibana                 replicated  1/1       kibana@sha256:6995a2d25709a62694a937b8a529ff36da92ebee74bafd7bf00e6caf6db2eb03
    70  9gc5m4met4he  vossibility_logstash               replicated  1/1       logstash@sha256:2dc8bddd1bb4a5a34e8ebaf73749f6413c101b2edef6617f2f7713926d2141fe
    71  axqh55ipl40h  vossibility_vossibility-collector  replicated  1/1       icecrime/vossibility-collector@sha256:f03f2977203ba6253988c18d04061c5ec7aab46bca9dfd89a9a1fa4500989fba
    72  ```
    73  
    74  ### DAB file
    75  
    76  ```bash
    77  $ docker stack deploy --bundle-file vossibility-stack.dab vossibility
    78  
    79  Loading bundle from vossibility-stack.dab
    80  Creating service vossibility_elasticsearch
    81  Creating service vossibility_kibana
    82  Creating service vossibility_logstash
    83  Creating service vossibility_lookupd
    84  Creating service vossibility_nsqd
    85  Creating service vossibility_vossibility-collector
    86  ```
    87  
    88  You can verify that the services were correctly created:
    89  
    90  ```bash
    91  $ docker service ls
    92  
    93  ID            NAME                               MODE        REPLICAS  IMAGE
    94  29bv0vnlm903  vossibility_lookupd                replicated  1/1       nsqio/nsq@sha256:eeba05599f31eba418e96e71e0984c3dc96963ceb66924dd37a47bf7ce18a662
    95  4awt47624qwh  vossibility_nsqd                   replicated  1/1       nsqio/nsq@sha256:eeba05599f31eba418e96e71e0984c3dc96963ceb66924dd37a47bf7ce18a662
    96  4tjx9biia6fs  vossibility_elasticsearch          replicated  1/1       elasticsearch@sha256:12ac7c6af55d001f71800b83ba91a04f716e58d82e748fa6e5a7359eed2301aa
    97  7563uuzr9eys  vossibility_kibana                 replicated  1/1       kibana@sha256:6995a2d25709a62694a937b8a529ff36da92ebee74bafd7bf00e6caf6db2eb03
    98  9gc5m4met4he  vossibility_logstash               replicated  1/1       logstash@sha256:2dc8bddd1bb4a5a34e8ebaf73749f6413c101b2edef6617f2f7713926d2141fe
    99  axqh55ipl40h  vossibility_vossibility-collector  replicated  1/1       icecrime/vossibility-collector@sha256:f03f2977203ba6253988c18d04061c5ec7aab46bca9dfd89a9a1fa4500989fba
   100  ```
   101  
   102  ## Related commands
   103  
   104  * [stack ls](stack_ls.md)
   105  * [stack ps](stack_ps.md)
   106  * [stack rm](stack_rm.md)
   107  * [stack services](stack_services.md)