jenkins作业不在奴隶节点中构建

时间:2016-10-24 03:24:04

标签: jenkins

通过配置在奴隶机器中构建作业(构建码头图像,来自github的代码),但它没有建立成功...如果在主站中更改作业,则构建成功


奴隶构建消息:

Started by user admin
Building remotely on jenkins-slave (slave) in workspace /home/jenkins/workspace/71bnh8co385ctlmoxgbumdnpnet3ywq
Cloning the remote Git repository
Cloning repository git@github.com:xxxxxxx/wcount.git
 > git init /home/jenkins/workspace/71bnh8co385ctlmoxgbumdnpnet3ywq # timeout=10
Fetching upstream changes from git@github.com:xxxxxxx/wcount.git
 > git --version # timeout=10
using GIT_SSH to set credentials 71bnh6gke9kmabye9qu2qsazzpofjsa
 > git -c core.askpass=true fetch --tags --progress     git@github.com:xxxxxxx/wcount.git +refs/heads/*:refs/remotes/origin/*
 > git config remote.origin.url git@github.com:xxxxxxx/wcount.git # timeout=10
 > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
 > git config remote.origin.url git@github.com:xxxxxxx/wcount.git # timeout=10
Fetching upstream changes from git@github.com:xxxxxxx/wcount.git
using GIT_SSH to set credentials 71bnh6gke9kmabye9qu2qsazzpofjsa
 > git -c core.askpass=true fetch --tags --progress     git@github.com:xxxxxxx/wcount.git +refs/heads/*:refs/remotes/origin/*
 > git rev-parse origin/master^{commit} # timeout=10
Checking out Revision 5730301886fa5c02522705de817c5ddac0f0dbce (origin/master)
 > git config core.sparsecheckout # timeout=10
 > git checkout -f 5730301886fa5c02522705de817c5ddac0f0dbce
 > git rev-list 5730301886fa5c02522705de817c5ddac0f0dbce # timeout=10
ERROR: Build step failed with exception
java.lang.IllegalArgumentException: configured dockerFolder     '/home/jenkins/workspace/71bnh8co385ctlmoxgbumdnpnet3ywq' does not exist.
        at     org.jenkinsci.plugins.dockerbuildstep.cmd.CreateImageCommand.execute(CreateImageCommand.java:93)
        at org.jenkinsci.plugins.dockerbuildstep.DockerBuilder.perform(DockerBuilder.java:75)



主工作区是/ home / jenkins_home / workspace

奴隶工作区是/ home / jenkins / workspace

我可以在从节点中找到/ home / jenkins / workspace / 71bnh8co385ctlmoxgbumdnpnet3ywq目录。

我猜这个构建在主节点上,但我看到了从队列中的任务

2 个答案:

答案 0 :(得分:2)

jenkins docker-build-step插件不支持在从属节点上运行任务,因此您可以更改一些代码来支持它。    向slave添加一个jar,它可以创建图像并推送图像。然后master在slave中调用这个jar

答案 1 :(得分:0)

不确定是否就是这种情况,但似乎Jenkins在Build阶段将Docker build/create任务中的Dockerfile路径设置为$WORKSPACE/docker,因此您必须确保拥有该文件夹(包含Dockerfile)在您的workspace / git repo中或者从上面的路径ENV中删除docker(这是一个更好的解决方案,imho),Jenkins将从主工作空间/ git目录中读取Dockerfile。希望有所帮助。