-
Bug
-
Resolution: Unresolved
-
Minor
-
None
Any freestyle job with a build step "Execute Docker command" with "Docker command" set to "Create/build image" results in:
ERROR: Build step failed with exception java.lang.NullPointerException: uri was not specified at java.base/java.util.Objects.requireNonNull(Objects.java:246) at com.github.dockerjava.core.DefaultDockerClientConfig$Builder.withDockerHost(DefaultDockerClientConfig.java:365) at org.jenkinsci.plugins.dockerbuildstep.DockerBuilder$DescriptorImpl.createDockerClient(DockerBuilder.java:133) at org.jenkinsci.plugins.dockerbuildstep.DockerBuilder$DescriptorImpl.getDockerClient(DockerBuilder.java:235) at org.jenkinsci.plugins.dockerbuildstep.DockerBuilder$DescriptorImpl.getDockerClient(DockerBuilder.java:227) at org.jenkinsci.plugins.dockerbuildstep.DockerBuilder.perform(DockerBuilder.java:73) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:818) at hudson.model.Build$BuildExecution.build(Build.java:199) at hudson.model.Build$BuildExecution.doRun(Build.java:164) at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:526) at hudson.model.Run.execute(Run.java:1900) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44) at hudson.model.ResourceController.execute(ResourceController.java:101) at hudson.model.Executor.run(Executor.java:442) Build step 'Execute Docker command' marked build as failure Finished: FAILURE
This exception disappeared after changing the option [Jenkins -> Manage Jenkins -> Configure System -> Docker Builder] from blank to unix:///var/run/docker.sock as it is said in the documentation:
https://plugins.jenkins.io/docker-build-step/#plugin-content-set-docker-url
However, the root cause of the error was not clear from the error message. I leave this bug open, because the error handling should be fixed: the should be no NullPointerException.