Jenkins 流水线插件是否支持 Docker Compose? [英] Does Jenkins Pipeline Plug-in support Docker Compose?

查看:19
本文介绍了Jenkins 流水线插件是否支持 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 中或通过 CloudBees docker 插件为管道提供对 Docker Compose 的原生支持.

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... finally to 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.ymlway-to-accomplish-it">maven build.

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是目前的解决方案...

Manually installing docker-cli and docker-compose with the same version as host's is the solution for now...

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆