How to stop a deployed docker stack?

前端 未结 1 358
谎友^
谎友^ 2021-02-05 05:55

I just completed the beginners Docker tutorials and would like to know how to clean up.

I deployed a stack and with a few different service using the below command:

<
相关标签:
1条回答
  • 2021-02-05 06:49

    You can remove a stack with:

    docker stack rm vote
    

    At present, this is still a detached operation that will take time to run in the background.


    If for some reason you still want the stack and service definitions, you can scale the "replicated" services down to 0 replicas, and "global" services you can add a constraint that doesn't match any node.

    docker service update --replicas 0 $service_name
    docker service update --constraint-add no_such_node=true $service_name
    
    0 讨论(0)
提交回复
热议问题