Executing docker stack deployagain for me is the way to upgrade services. As Answer by Francois , as well as in my own experience, it updates only those services that need to be updated.
But sometimes it seems that itโs easier to test the material just to restart one service. In my case, I had to clear the volume and update the service to start it as if it were fresh. I am not sure if there is a flaw in the method that I will describe. I tested it in my development stack and it worked fine for me.
Get the identifier of the service you want to demolish, then use docker service update --force <id>it to force a service update that will effectively redeploy it.
$ docker stack services <stack_name>
ID NAME ...
3xrdy2c7pfm3 stack-name_api ...
$ docker service update --force 3xrdy2c7pfm3
The flag --forcewill cause the service to update, causing it to reboot.
source
share