docker - 在詹金斯中找不到 docker-compose 命令
问题描述
我正在尝试使用 Jenkins 连接到 bitbucket 并使用 docker-compose 构建图像并将构建的图像推送到 docker-hub。我可以使用 Jenkins 管道连接到 bitbucket。但是,在构建管道时,我在 Jenkins 中遇到了 docker-compose 错误。
我已经尝试在我的管道中包含 docker-compose 的完整路径,但我仍然遇到同样的错误。也试过,把它放在一个路径变量中,这也导致了同样的错误。下面是代码。docker-compose 文件的路径与“克隆 Git”步骤中的 bitbucket 克隆完全相同。任何帮助表示赞赏,谢谢!
pipeline {
environment {
registry = "xxxx/xxx"
registryCredential = 'xxxxx'
dockerImage = ''
}
agent any
stages {
stage('Cloning Git') {
steps {
git branch: 'dev',
credentialsId: 'xxxx',
url: 'xxxx'
}
}
stage('Printing content') {
steps {
sh 'pwd; ls -l;'
}
}
stage('Building Image') {
steps {
sh './usr/bin/docker-compose -f docker-compose.yml up -d --build'
}
}
}
}
解决方案
推荐阅读
- python - 在 Python 3.8 中调试随机坠落物体的编码
- reactjs - 与材质 ui 重叠网格
- clojurescript - 如果错误使用了承诺,则必须重新启动 Cider repl
- node.js - API Gateway 为 requestParameter 键映射多个值
- keras - 多对多序列预测可变长度输入/输出inkeras
- powershell - PS脚本中的硬编码域名
- reactjs - BrowseSEO 无法读取 Next.js React App 中的 META 标签
- javascript - 如何提前缓冲来自在线的视频,如 reat-native 中的 youtube?
- zsh - zinit:integer:7: IFS: 不能改变特殊参数的类型
- python - 如何在 django 中删除对象?