简体   繁体   中英

jenkins job build not in slave node

build job( build docker image ,code from github) in slave machine by configuration,but it do not build success...if change job in master ,it build success


slave build message :

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)



master workspace is /home/jenkins_home/workspace

slave workspace is /home/jenkins/workspace

i can find /home/jenkins/workspace/71bnh8co385ctlmoxgbumdnpnet3ywq directory in slave node。

i guess this build in master node,but i see the task in slave queue

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

Not sure if that's the case here, but it seems that Jenkins sets a path to Dockerfile in Docker build/create task at Build stage as $WORKSPACE/docker so you either have to ensure you have that folder (containing Dockerfile and other needed files) in your workspace/git repo or just remove docker from path ENV above (which is a better solution, imho) and Jenkins will read Dockerfile from main workspace/git directory. Hope that helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM