在尝试使用jenkins构建docker镜像时如何处理NPE?

时间:2016-06-13 08:38:15

标签: jenkins docker docker-build

我正在尝试使用jenkins插件docker-build-step构建一个docker镜像。我只是尝试创建图像的标准设置:

enter image description here

然而,当我尝试构建时,我得到一个NullPointerException。起初我认为它与this question中的那个相同,但后来我仔细观察并发现它不是(我没有完全理解这个问题的答案,所以我没有设法排除肯定这不是一个相关的问题)

First time build. Skipping changelog.
ERROR: Build step failed with exception
java.lang.NullPointerException
    at com.github.dockerjava.jaxrs.DockerCmdExecFactoryImpl.init(DockerCmdExecFactoryImpl.java:105)
    at com.github.dockerjava.core.DockerClientImpl.withDockerCmdExecFactory(DockerClientImpl.java:64)
    at com.github.dockerjava.core.DockerClientBuilder.build(DockerClientBuilder.java:63)
    at org.jenkinsci.plugins.dockerbuildstep.DockerBuilder$DescriptorImpl.createDockerClient(DockerBuilder.java:132)
    at org.jenkinsci.plugins.dockerbuildstep.DockerBuilder$DescriptorImpl.getDockerClient(DockerBuilder.java:204)
    at org.jenkinsci.plugins.dockerbuildstep.DockerBuilder.perform(DockerBuilder.java:68)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:782)
    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:534)
    at hudson.model.Run.execute(Run.java:1738)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:410)
Build step 'Execute Docker command' marked build as failure
Finished: FAILURE

我该怎么办这个例外?

0 个答案:

没有答案