I'm trying to use the docker plugin on Jenkins to run an instance of an existing container. Docker version 1.6.0, build 4749651
I've chosen "create container" Entered the image id for the image name, and tried a host http://172.16.42.43:4243 and also tried an empty host. I keep getting this error:
ERROR: Build step failed with exception
java.lang.NullPointerException: uri was not specified
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:204)
at com.github.dockerjava.core.DockerClientConfig$DockerClientConfigBuilder.withUri(DockerClientConfig.java:406)
at org.jenkinsci.plugins.dockerbuildstep.DockerBuilder$DescriptorImpl.createDockerClient(DockerBuilder.java:123)
at org.jenkinsci.plugins.dockerbuildstep.DockerBuilder$DescriptorImpl.getDockerClient(DockerBuilder.java:201)
at org.jenkinsci.plugins.dockerbuildstep.DockerBuilder.perform(DockerBuilder.java:71)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
at hudson.model.Build$BuildExecution.build(Build.java:205)
at hudson.model.Build$BuildExecution.doRun(Build.java:162)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537)
at hudson.model.Run.execute(Run.java:1744)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:374)
Build step 'Execute Docker container' marked build as failure
Can someone tell me how to fix it? Also, if anyone has used this plugin before, please let me know if this has ever worked.
Also tried the "Execute docker container"->start containers with the container id specified resulting in the same error.
Another approach: I tried using the Execute shell plug in and I'm getting this error:
+ docker start d023eec1ff34
Post http:///var/run/docker.sock/v1.18/containers/d023eec1ff34/start: dial unix /var/run/docker.sock: permission denied. Are you trying to connect to a TLS-enabled daemon without TLS?
time="2015-05-05T10:26:34-07:00" level=fatal msg="Error: failed to start one or more containers"
If I just go to the terminal, switch to jenkins user and run the docker start command, it works fine. If someone know how to fix it this way, that would be great as well.