I am using docker-compose for deploying several containers on the same host. My images are built in Google Cloud Build and stored on gcr.io; I am not using docker-compose to build my images.

When I run docker-compose pull followed by docker-compose up -d, new containers are created for my images. However, if I run docker ps in another tab, I observe that my containers go offline for a few seconds while the new ones are being created.

Is there a way to tell docker-compose to recreate and then restart the containers without any downtime?


docker-compose up by itself does not support any way of deploying with zero downtime.


You'll need to implement your own blue/green deployment or have a look at kubernetes's rolling update: https://kubernetes.io/docs/tutorials/kubernetes-basics/update/update-intro/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.