Jenkins Pipeline插件是否支持Docker Compose? [英] Does Jenkins Pipeline Plug-in support 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... 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.
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-cli
和docker-compose
是目前的解决方案...
Manually installing
docker-cli
anddocker-compose
with the same version as host's is the solution for now...
这篇关于Jenkins Pipeline插件是否支持Docker Compose?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!