Jenkins Pipeline插件是否支持Do​​cker Compose? [英] Does Jenkins Pipeline Plug-in support Docker Compose?

查看:141
本文介绍了Jenkins Pipeline插件是否支持Do​​cker 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... 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-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的流水线,假设您的Jenkins服务器上安装了docker-compose.

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

注意:一年后(2017年8月),

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 Pipeline插件是否支持Do​​cker Compose?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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