gpt4 book ai didi

docker - docker-compose:找不到命令jenkins管道

转载 作者:行者123 更新时间:2023-12-02 18:21:16 25 4
gpt4 key购买 nike

当我尝试在蓝色的海洋中启动此代码https://github.com/Sabrjkee/docker-qrcode-generator.git时,我收到此消息

> [ker-qrcode-generator_master-RJ4RZWEFLU27HJ7Q4MAGBQFTT7E6MLQM6BRPZAHRAEYIU27NR5VA]
> Running shell script
>
> + docker-compose --version
>
> /var/lib/jenkins/workspace/ker-qrcode-generator_master-RJ4RZWEFLU27HJ7Q4MAGBQFTT7E6MLQM6BRPZAHRAEYIU27NR5VA@tmp/durable-4dbe9184/script.sh:
> line 2: docker-compose: command not found
>
> script returned exit code 127
在控制台
$ docker-compose --version
docker-compose version 1.17.0, build ac53b73
$ docker --version
Docker version 18.03.1-ce, build 3dfb8343b139d6342acfd9975d7f1068b5b1c3d3

最佳答案

看起来Jenkins管道中的docker-compose中没有包含PATH二进制文件的文件夹。

您可以使用environment部分添加它:

pipeline {

environment {
PATH = "$PATH:<folder_where_docker-compose_is>"
}
}

例如,如果 docker-compose位于:
$ which docker-compose
/usr/local/bin/docker-compose
Jenkinsfile将修改为:
pipeline {

environment {
PATH = "$PATH:/usr/local/bin"
}
}

关于docker - docker-compose:找不到命令jenkins管道,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52052347/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com