Details
-
Bug
-
Status: Resolved (View Workflow)
-
Blocker
-
Resolution: Won't Fix
-
jenkins 1.625
docker-commons:1.3.1
docker-workflow:1.2
durable-task:1.8
pipeline-rest-api:1.0
pipeline-stage-view:1.0
pipeline-utility-steps:1.0
workflow-aggregator:1.14
workflow-api:1.14
workflow-basic-steps:1.14
workflow-cps-checkpoint:1.9
workflow-cps-global-lib:1.14
workflow-cps:1.14
workflow-durable-task-step:1.14
workflow-job:1.14
workflow-multibranch:1.14
workflow-scm-step:1.14
workflow-step-api:1.14
workflow-support:1.14jenkins 1.625 docker-commons:1.3.1 docker-workflow:1.2 durable-task:1.8 pipeline-rest-api:1.0 pipeline-stage-view:1.0 pipeline-utility-steps:1.0 workflow-aggregator:1.14 workflow-api:1.14 workflow-basic-steps:1.14 workflow-cps-checkpoint:1.9 workflow-cps-global-lib:1.14 workflow-cps:1.14 workflow-durable-task-step:1.14 workflow-job:1.14 workflow-multibranch:1.14 workflow-scm-step:1.14 workflow-step-api:1.14 workflow-support:1.14
Description
create a job called "my job" with the following pipeline
node ("docker") { sh 'pwd' img = docker.image("ubuntu") img.inside { sh 'pwd' } }
[Pipeline] Allocate node : Start Running on docker in /root/workspace/workspace/test-jobs/jnord/docker inside [Pipeline] node { [Pipeline] sh [docker inside] Running shell script + pwd /root/workspace/workspace/test-jobs/jnord/docker inside [Pipeline] sh [docker inside] Running shell script + docker inspect -f . ubuntu . [Pipeline] Run build steps inside a Docker container : Start $ docker run -t -d -u 0:0 -w "/root/workspace/workspace/test-jobs/jnord/docker inside" -v "/root/workspace/workspace/test-jobs/jnord/docker inside:/root/workspace/workspace/test-jobs/jnord/docker inside:rw" -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** ubuntu cat [Pipeline] withDockerContainer { [Pipeline] sh [docker inside] Running shell script sh: 1: cannot create /root/workspace/workspace/test-jobs/jnord/docker inside@tmp/durable-5ea3c644/pid: Directory nonexistent sh: 1: cannot create /root/workspace/workspace/test-jobs/jnord/docker inside@tmp/durable-5ea3c644/jenkins-log.txt: Directory nonexistent sh: 1: cannot create /root/workspace/workspace/test-jobs/jnord/docker inside@tmp/durable-5ea3c644/jenkins-result.txt: Directory nonexistent [Pipeline] } //withDockerContainer $ docker stop 260e1e96255fd938e64d6bcd296ce616e01a40ece5ef093dfd97325418247904 $ docker rm -f 260e1e96255fd938e64d6bcd296ce616e01a40ece5ef093dfd97325418247904 [Pipeline] Run build steps inside a Docker container : End [Pipeline] } //node [Pipeline] Allocate node : End [Pipeline] End of Pipeline ERROR: script returned exit code -2 Finished: FAILURE
Attachments
Issue Links
- is related to
-
JENKINS-33962 docker.inside broken on OSX
-
- Resolved
-
-
JENKINS-34194 docker volume mounts not working as expected when run from within swarm container
-
- Resolved
-
-
JENKINS-35217 docker.inside broken
-
- Closed
-
Hello again,
You are absolutely right and I went debugging again to find out...that the issue was on my side
To give more context for people coming here, it is in fact the docker that was inside my jenkins docker image that was not correct. I installed it using apt-get install from the official jenkins image which was a mistake as I ended up with a docker client version 1.6.2 (communicating with a docker deamon on my host running a version 12...).
The problem finally came from the fact the docker inspect output format was changed for volumes in docker 1.8 (I'm pretty sure this comes from this PR). As a consequence, the plugin did not find any volumes, falling back to a --volume mount.
Installing the latest version of docker using curl -sSL https://get.docker.com/ | sh solved the issue. I guess this means the issue can be closed. If you are interested, I made a pull request to add an error in the logs saying : "The docker version is less than v1.8. Running a 'docker.inside' from inside a container will not work."