Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker-compose restart only updated images

Tags:

I have a docker-compose "cluster" and sometime I update the image files for some containers. I rebuild them using docker-compose build. I would like to know if there is a way to restart only the containers that have a new image automatically. Ie. I don't want to do docker-compose scale service=0 && docker-compose scale service=3 for all containers I updated.

Thank you very much for your help

like image 452
DARK_DUCK Avatar asked Jun 03 '16 08:06

DARK_DUCK


1 Answers

This command updates the containers that have a newer image (than the one currently running):

docker-compose up -d --no-deps <service> 
like image 113
jazgot Avatar answered Oct 05 '22 23:10

jazgot