Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update docker stack without restarting all services

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?

like image 931
Sunil Agarwal Avatar asked May 18 '17 15:05

Sunil Agarwal


Video Answer


2 Answers

docker service update --image does the trick.

Check the docker service update docs.

like image 75
herm Avatar answered Oct 19 '22 03:10

herm


Redeploying the stack with changed configuration(docker-compose.yml file) solves the problem see https://docs.docker.com/engine/reference/commandline/stack_deploy/#extended-description. There they stated "Create and update a stack from a compose or a dab file on the swarm." Also i dont see any command like 'docker stack update '. So this can solve the problem.

like image 38
Amit Dighe Avatar answered Oct 19 '22 01:10

Amit Dighe