Failed to create docker image exception (Docker Slaves plugin)

924 views
Skip to first unread message

Hugo

unread,
Aug 14, 2017, 2:42:19 AM8/14/17
to jenkins...@googlegroups.com
Hello, I am experiencing an error while trying to use the docker slaves plugin. I set up the jenkins job in the following way:


So the job should clone the github repo (which contains the Dockerfile) and build the image, but when I press the build now option the following error shows up:

Started by user admin
Start Docker container to host the build
$ docker volume create
$ docker create --interactive --log-driver=none --env TMPDIR=/home/jenkins/.tmp --user 10000:10000 --rm --volume f12da13d31f32a041ea64d2f07633e575d691b4d9c360318cab3399c3719d820:/home/jenkins/ jenkins/agent/ java -Djava.io.tmpdir=/home/jenkins/.tmp -jar /home/jenkins/slave.jar
invalid reference format
Start Docker container to host the build
$ docker volume inspect -f '{{.Name}}' f12da13d31f32a041ea64d2f07633e575d691b4d9c360318cab3399c3719d820
$ docker create --interactive --log-driver=none --env TMPDIR=/home/jenkins/.tmp --user 10000:10000 --rm --volume f12da13d31f32a041ea64d2f07633e575d691b4d9c360318cab3399c3719d820:/home/jenkins/ jenkins/agent/ java -Djava.io.tmpdir=/home/jenkins/.tmp -jar /home/jenkins/slave.jar
invalid reference format
FATAL: java.io.IOException: Failed to create docker image
java.io.IOException: Failed to create docker image
	at it.dockins.dockerslaves.drivers.CliDockerDriver.launchRemotingContainer(CliDockerDriver.java:176)
	at it.dockins.dockerslaves.DefaultDockerProvisioner.launchRemotingContainer(DefaultDockerProvisioner.java:88)
	at it.dockins.dockerslaves.DockerComputerLauncher.launch(DockerComputerLauncher.java:58)
	at it.dockins.dockerslaves.DockerComputerLauncher.launch(DockerComputerLauncher.java:49)
	at it.dockins.dockerslaves.api.OneShotSlave.provision(OneShotSlave.java:123)
Caused: it.dockins.dockerslaves.api.OneShotExecutorProvisioningException
	at it.dockins.dockerslaves.api.OneShotSlave.provisionFailed(OneShotSlave.java:145)
	at it.dockins.dockerslaves.api.OneShotSlave.provision(OneShotSlave.java:129)
	at it.dockins.dockerslaves.api.OneShotSlave.createLauncher(OneShotSlave.java:154)
	at it.dockins.dockerslaves.DockerSlave.createLauncher(DockerSlave.java:96)
	at hudson.model.AbstractBuild$AbstractBuildExecution.createLauncher(AbstractBuild.java:517)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:448)
	at hudson.model.Run.execute(Run.java:1735)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:405)
Finished: FAILURE

I have been trying to debug it but ran into a dead end. Can anyone offer some advice?

Regards,

Hugo


Björn Pedersen

unread,
Aug 14, 2017, 9:34:25 AM8/14/17
to Jenkins Users
Hi,

this is a know bug, see discussion here: https://groups.google.com/forum/#!topic/jenkinsci-users/k14ZkFV69CA

In global config,  you need to remove the final slash from

jenkins/agent/


Björn

Hugo Alfonso Zúñiga Calvo

unread,
Aug 14, 2017, 4:12:43 PM8/14/17
to Jenkins Users
Hello, Thanks for the fast answer. But this doesn't seem to be the issue. I tried removing the "/" from the jenkins/agent/ but it keeps giving the same error. What I don't understand is why it is trying to create the container without even building the image. Because it doesn't seem to be cloning the repo where the Dockerfile is. I had already tried this plugin before with the same repo and it was working correctly, but now that I am redoing everything I did last time it is showing this error. Any idea why? 

Archimedes Trajano

unread,
Mar 19, 2018, 12:04:50 PM3/19/18
to Jenkins Users
use "jenkins/slave" that was the one that finally worked for me.
Reply all
Reply to author
Forward
0 new messages