简体   繁体   中英

Google Jib with docker-compose application, Fast way to restart application after rebuild image to Docker daemon

I Am using com.google.cloud.tools.jib version 3.2.1 in my spring boot Gradle build file.

The repo I am working with has to be run in a docker-compose application as it will only work if there are other services sharing info with it.

Am updating the code to add authentication, But that's not the issue here.

When ever I update anything, My process is as follow:

  1. Update Code.
  2. Gradle jibDockerBuild # to build to a Docker daemon
  3. docker-compose down # to stop and remove old application
  4. docker-compose up # to start the application with new services updated

Question : Is there a smoother/faster way to do this kind of process, I mean without turning off the docker-compose application down and up with every single update?

I was thinking about something like turning my service down and then up, As a single service. But I found nothing.

Have a look at docker-compose up --help :

If you want to force Compose to stop and recreate all containers, use the --force-recreate flag.

So, docker-compose up --force-recreate will allow you to recreate the containers without doing a docker-compose down which will also remove networks.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM