简体   繁体   English

带有 docker-compose 应用程序的 Google Jib,在将映像重建到 Docker 守护程序后重新启动应用程序的快速方法

[英]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.我在我的 spring 启动 Gradle 构建文件中使用com.google.cloud.tools.jib版本3.2.1

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.我正在使用的 repo 必须在 docker-compose 应用程序中运行,因为它只有在有其他服务与之共享信息时才能工作。

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 Gradle jibDockerBuild # 构建到 Docker 守护进程
  3. docker-compose down # to stop and remove old application docker-compose down # 停止并删除旧应用程序
  4. docker-compose up # to start the application with new services updated docker-compose up # 使用更新的新服务启动应用程序

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?问题:有没有一种更流畅/更快的方法来完成这种过程,我的意思是每次更新都不会关闭 docker-compose 应用程序?

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 :看看docker-compose up --help

If you want to force Compose to stop and recreate all containers, use the --force-recreate flag.如果要强制 Compose 停止并重新创建所有容器,请使用--force-recreate标志。

So, docker-compose up --force-recreate will allow you to recreate the containers without doing a docker-compose down which will also remove networks.因此, docker-compose up --force-recreate将允许您在不执行docker-compose down的情况下重新创建容器,这也将删除网络。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 Google Cloud Run (docker-compose) 上使用 Celery + Reddis 部署 Django 应用程序 - How to deploy Django Application with Celery + Reddis on Google Cloud Run (docker-compose) Docker 图片适用于 docker-compose up 但不适用于 Amazon ECS 或 Heroku - Docker Image works with docker-compose up but not on Amazon ECS or Heroku 如何使用 docker-compose 将容器部署到谷歌云? - How to deploy container using docker-compose to google cloud? 如何在谷歌云运行上运行 docker-compose? - How to run docker-compose on google cloud run? 如何从 docker-compose 文件在 CDK 中创建 Docker 图像资源? - How do I create Docker image assets in CDK from a docker-compose file? 有什么方法可以仅使用 JIB 从给定的 jar 创建 docker 图像? - Is there any way to use JIB only for creating a docker image from the given jar? 使用 Jib 获取特定版本的图像(Maven、Docker、testcontainers) - Getting a specific version of an image with Jib (Maven, Docker, testcontainers) 将 docker-compose 部署到 Cloud Run 或 GCP? - Deploying docker-compose to Cloud Run OR GCP? 使用 Rancher OS 运行 docker-compose - Running docker-compose with Rancher OS 使用jib创建docker镜像时401 Unauthorized - 401 Unauthorized when using jib to create docker image
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM