How to rebuild and update a container without downtime with docker-compose?

后端 未结 8 1681
春和景丽
春和景丽 2021-01-29 23:00

I enjoy a lot using docker-compose.

Eg. on my server, when I want to update my app with minor changes, I only need to git pull origin master && docker-comp

8条回答
  •  心在旅途
    2021-01-29 23:37

    Run the following commands:

    docker-compose pull

    docker-compose up -d --no-deps --build

    As the top rated answer mentioned docker-compose up -d --no-deps --build will restart a single service without taking down the whole compose. I just wanted to add to the top answer in case anyone is unsure how to update an image without restarting the container.

提交回复
热议问题