How to update docker stack without restarting all services

Sunil Agarwal picture Sunil Agarwal · May 18, 2017 · Viewed 10.3k times · Source

I have a swarm cluster wherein different technology dockers are deployed. (Zookeeper, Kafka, Elastic, Storm and custom web application)

Web application goes under tremendous changes and have to update the stack everytime web docker changes. Once in a while there will be updates to Elasticsearch image.

When i run docker stack deploy, it goes and restarts all existing docker services which are not even changed. This hampers whole stack and there is a downtime for whole application. Docker stack does not have option of update.

Someone has solution for this?

Answer

herm picture herm · May 18, 2017

docker service update --image does the trick.

Check the docker service update docs.