maven构建并推送docker镜像时,出现如下问题:

com.github.dockerjava.api.exception.DockerClientException: Unsupported protocol scheme found: ''. Only 'tcp://' or 'unix://' supported.
	at com.github.dockerjava.core.DefaultDockerClientConfig.checkDockerHostScheme(DefaultDockerClientConfig.java:101)
	at com.github.dockerjava.core.DefaultDockerClientConfig.<init>(DefaultDockerClientConfig.java:87)
	at com.github.dockerjava.core.DefaultDockerClientConfig$Builder.build(DefaultDockerClientConfig.java:451)
	at com.github.dockerjava.core.DockerClientBuilder.getInstance(DockerClientBuilder.java:23)
	at org.jenkinsci.plugins.dockerbuildstep.DockerBuilder$DescriptorImpl.createDockerClient(DockerBuilder.java:143)
	at org.jenkinsci.plugins.dockerbuildstep.DockerBuilder$DescriptorImpl.getDockerClient(DockerBuilder.java:229)
	at org.jenkinsci.plugins.dockerbuildstep.DockerBuilder$DescriptorImpl.getDockerClient(DockerBuilder.java:221)
	at org.jenkinsci.plugins.dockerbuildstep.DockerBuilder.perform(DockerBuilder.java:70)
	at org.jenkins_ci.plugins.run_condition.BuildStepRunner$2.run(BuildStepRunner.java:110)
	at org.jenkins_ci.plugins.run_condition.BuildStepRunner$Fail.conditionalRun(BuildStepRunner.java:154)
	at org.jenkins_ci.plugins.run_condition.BuildStepRunner.perform(BuildStepRunner.java:105)
	at org.jenkinsci.plugins.conditionalbuildstep.singlestep.SingleConditionalBuilder.perform(SingleConditionalBuilder.java:108)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
	at hudson.model.Build$BuildExecution.build(Build.java:206)
	at hudson.model.Build$BuildExecution.doRun(Build.java:163)
	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:504)
	at hudson.model.Run.execute(Run.java:1806)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:429)

jenkins全局设置,找到Docker Builder,输入tcp://localhost:2375 (远程访问的docker api地址),保存

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐