原因:com.spotify.docker.client.shade.javax.ws.rs.ProcessingException:org.apache.http.conn.HttpHostConnectException:Microservices
我正在从生成代码,并且没有在我的windows计算机上安装docker。我想执行源代码。有人能告诉我如何修复这个错误吗 我已经下载了使用git的代码,并且存在.git文件夹原因:com.spotify.docker.client.shade.javax.ws.rs.ProcessingException:org.apache.http.conn.HttpHostConnectException:Microservices,java,microservices,Java,Microservices,我正在从生成代码,并且没有在我的windows计算机上安装docker。我想执行源代码。有人能告诉我如何修复这个错误吗 我已经下载了使用git的代码,并且存在.git文件夹 Caused by: com.spotify.docker.client.DockerException: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: or
Caused by: com.spotify.docker.client.DockerException: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: org.apache.http.conn.HttpHostConnectException: Connect to localhost:2375 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect
at com.spotify.docker.client.DefaultDockerClient.propagate (DefaultDockerClient.java:1226)
at com.spotify.docker.client.DefaultDockerClient.request (DefaultDockerClient.java:1167)
at com.spotify.docker.client.DefaultDockerClient.version (DefaultDockerClient.java:330)
at com.spotify.docker.client.DefaultDockerClient.authRegistryHeader (DefaultDockerClient.java:1265)
at com.spotify.docker.client.DefaultDockerClient.build (DefaultDockerClient.java:918)
at com.spotify.docker.client.DefaultDockerClient.build (DefaultDockerClient.java:877)
at com.spotify.docker.BuildMojo.buildImage (BuildMojo.java:532)
at com.spotify.docker.BuildMojo.execute (BuildMojo.java:322)
at com.spotify.docker.AbstractDockerMojo.execute (AbstractDockerMojo.java:113)
at com.spotify.docker.BuildMojo.execute (BuildMojo.java:81)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
pom.xml
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${docker.plugin.version}</version>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
<configuration>
<imageName>${docker.image.prefix}/${project.artifactId}</imageName>
<dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
</plugins>
</build>
org.springframework.boot
springbootmaven插件
com.spotify
docker maven插件
${docker.plugin.version}
安装
建造
${docker.image.prefix}/${project.artifactId}
${project.basedir}/src/main/docker
/
${project.build.directory}
${project.build.finalName}.jar
右键单击通知区域中的Docker desktop图标,进入Docker desktop的设置,然后选中(选择)打开Expose daemontcp://localhost:2375 不带TLS选项
参考: