Home > Software design >  Google Jib with docker-compose application, Fast way to restart application after rebuild image to D
Google Jib with docker-compose application, Fast way to restart application after rebuild image to D

Time:09-06

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.

CodePudding user response:

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.

  • Related