github.com/khulnasoft/cli@v0.0.0-20240402070845-01bcad7beefa/docs/reference/commandline/stack_rm.md (about)

     1  # stack rm
     2  
     3  <!---MARKER_GEN_START-->
     4  Remove one or more stacks
     5  
     6  ### Aliases
     7  
     8  `docker stack rm`, `docker stack remove`, `docker stack down`
     9  
    10  ### Options
    11  
    12  | Name             | Type   | Default | Description                   |
    13  |:-----------------|:-------|:--------|:------------------------------|
    14  | `-d`, `--detach` | `bool` | `true`  | Do not wait for stack removal |
    15  
    16  
    17  <!---MARKER_GEN_END-->
    18  
    19  ## Description
    20  
    21  Remove the stack from the swarm.
    22  
    23  > **Note**
    24  >
    25  > This is a cluster management command, and must be executed on a swarm
    26  > manager node. To learn about managers and workers, refer to the
    27  > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the
    28  > documentation.
    29  
    30  ## Examples
    31  
    32  ### Remove a stack
    33  
    34  This will remove the stack with the name `myapp`. Services, networks, and secrets
    35  associated with the stack will be removed.
    36  
    37  ```console
    38  $ docker stack rm myapp
    39  
    40  Removing service myapp_redis
    41  Removing service myapp_web
    42  Removing service myapp_lb
    43  Removing network myapp_default
    44  Removing network myapp_frontend
    45  ```
    46  
    47  ### Remove multiple stacks
    48  
    49  This will remove all the specified stacks, `myapp` and `vossibility`. Services,
    50  networks, and secrets associated with all the specified stacks will be removed.
    51  
    52  ```console
    53  $ docker stack rm myapp vossibility
    54  
    55  Removing service myapp_redis
    56  Removing service myapp_web
    57  Removing service myapp_lb
    58  Removing network myapp_default
    59  Removing network myapp_frontend
    60  Removing service vossibility_nsqd
    61  Removing service vossibility_logstash
    62  Removing service vossibility_elasticsearch
    63  Removing service vossibility_kibana
    64  Removing service vossibility_ghollector
    65  Removing service vossibility_lookupd
    66  Removing network vossibility_default
    67  Removing network vossibility_vossibility
    68  ```
    69  
    70  ## Related commands
    71  
    72  * [stack deploy](stack_deploy.md)
    73  * [stack ls](stack_ls.md)
    74  * [stack ps](stack_ps.md)
    75  * [stack services](stack_services.md)