Bootstrap FreeKB - Docker - docker restart stack service
Docker - docker restart stack service

Updated:   |  Docker articles

The docker stack ls command can be used to display the stacks. This command must be run from the swarm manager.

docker stack ls

 

Something like this should be returned.

NAME  SERVICES  ORCHESTRATOR
foo   3         Swarm
bar   1         Swarm

 

The docker stack services <stack name> command can be used to display the services in a stack.

docker stack services foo

 

Something like this should be returned.

ID                  NAME                   MODE                REPLICAS            IMAGE                                                              PORTS
ivq9h5yxl1om        foo_service001         replicated          1/1                 registry.example.com/foo_service001:latest   
kod8l0fc9alv        foo_service002         replicated          1/1                 registry.example.com/foo_service001:latest               *:8000->8000/tcp
l4frotyxwqzg        foo_service003         replicated          0/1                 

 

The docker service update command can be used to restart a service in a stack.

~]# docker service update foo_service003
foo_service003
overall progress: 1 out of 1 tasks 
1/1: running   [==================================================>] 
verify: Service converged

 

The --force flag can be used if the prior command fails to restart the service.

docker service update foo_service003 --force

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 7499ab in the box below so that we can be sure you are a human.