如何将jenkins作为具有docker管道的单个主代理运行?

时间:2018-01-25 22:15:41

标签: jenkins continuous-integration jenkins-pipeline

我正在尝试使用以下命令运行单个节点Jenkins:

我正在使用jenkins / jenkins:lts图片。到目前为止我找到并解决的问题是:

  1. 缺少docker二进制文件(通过扩展图像或绑定安装添加它)
  2. 缺少docker插件不属于标准推荐插件(通过仪表板添加)
  3. 它能够运行docker,但我仍然得到“Jenkins似乎没有在容器内运行”,并且脚本将不会执行。

    失败日志在这里:

    Jenkins does not seem to be running inside a container
    $ docker run -t -d -u 1000:1000 -w "/var/jenkins_home/jobs/Test  Pipeline/branches/master/workspace" -v "/var/jenkins_home/jobs/Test Pipeline/branches/master/workspace:/var/jenkins_home/jobs/Test Pipeline/branches/master/workspace:rw,z" -v "/var/jenkins_home/jobs/Test Pipeline/branches/master/workspace@tmp:/var/jenkins_home/jobs/Test Pipeline/branches/master/workspace@tmp:rw,z" -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** --entrypoint cat node:6.3
    [Pipeline] {
    [Pipeline] stage
    [Pipeline] { (build)
    [Pipeline] sh
    [workspace] Running shell script
    sh: 1: cannot create /var/jenkins_home/jobs/Test Pipeline/branches/master/workspace@tmp/durable-3f202d99/jenkins-log.txt: Directory nonexistent
    sh: 1: cannot create /var/jenkins_home/jobs/Test Pipeline/branches/master/workspace@tmp/durable-3f202d99/jenkins-result.txt: Directory nonexistent
    

    为什么它不相信它在容器中运行?它是否尝试在本地运行代理工作程序并失败?

0 个答案:

没有答案