我正在寻找一种在 Jenkins 2.0 中运行由多个容器组成的支持 Docker 的构建的方法。
有没有计划在 Pipeline 中原生支持 Docker Compose,或者通过 CloudBees docker 插件来支持管道。
或者是否可以/必须通过显式调用 sh docker-compose...
来解决这个问题?甚至可以在 try... finally
中使用它们
进一步控制服务生命周期。
编辑:第一个答案是提出一种在 jenkins 中构建 docker 容器的方法。这不是这里需要的。我(EngineerDollery)想使用 compose 在 jenkins 中调出我的目标平台,以便我可以将我的应用程序部署到它并运行端到端测试。
最佳答案
在 Jenkins bug tracking 中搜索后, JENKINS-35025建议在 docker 容器中运行作业时考虑 docker-compose.yml
,使用 maven build .
另见 Creating CI pipeline with Jenkins ,假设 docker-compose 已安装在您的 Jenkins 服务器上。
注意:一年后(2017 年 8 月),docker-compose is still not supported in the Docker Pipeline plugin
2018 年 7 月,Ivan Aracki笔记 in the comments :
Manually installing
docker-cli
anddocker-compose
with the same version as host's is the solution for now...
关于jenkins - Jenkins Pipeline 插件是否支持 Docker Compose?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37214628/