本文介绍了Jenkins Pipeline 插件是否支持 Docker Compose?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种在 Jenkins 2.0 中运行由多个容器组成的支持 Docker 的构建的方法.

I'm looking for a way to run Docker-enabled build consisting of multiple containers in Jenkins 2.0.

有没有计划在 Pipeline 中原生支持 Docker Compose,或者通过 CloudBees docker 插件来支持管道.

Are there any plans for native support of Docker Compose in Pipeline, or through CloudBees docker plugins for pipeline.

或者是否可以/必须通过显式调用 sh docker-compose... 来解决这个问题?甚至可以在 try... finally 中使用它们进一步控制服务生命周期.

Or can/must this be addressed by explicit calls sh docker-compose...? Maybe even use them inside try... finallyto further control services lifecycle.

第一个答案是提出一种在 jenkins 中构建 docker 容器的方法.这不是这里需要的.我(EngineerDollery)想使用 compose 在 jenkins 中调出我的目标平台,以便我可以将我的应用程序部署到它并运行端到端测试.

The first answer was to suggest a way to build docker containers in jenkins. This is not what is needed here. I (EngineerDollery) want to bring up my target platform in jenkins using compose so that I can deploy my app to it and run end-to-end tests.

推荐答案

Jenkins 错误跟踪JENKINS-35025 建议 docker-compose.yml,使用 maven 构建.

After searching in Jenkins bug tracking, JENKINS-35025 suggests docker-compose.yml is taken into account when running a job in a docker container, using a maven build.

另请参阅 创建 CI 管道使用 Jenkins,假设 docker-compose 已安装在您的 Jenkins 服务器上.

See also Creating CI pipeline with Jenkins, which assumes docker-compose is installed on your Jenkins server.

注意:一年后(2017 年 8 月),Docker Pipeline 插件中仍然不支持 docker-compose

Note: a year later (August 2017), docker-compose is still not supported in the Docker Pipeline plugin

2018 年 7 月,Ivan Aracki 注释 在评论中:

July 2018, Ivan Aracki notes in the comments:

目前的解决方案是手动安装 docker-clidocker-compose 与主机的版本相同...

这篇关于Jenkins Pipeline 插件是否支持 Docker Compose?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 06:36