异常信息

在centos上构建springboot项目的docker镜像时出现以下异常:

Failed to execute goal com.spotify:docker-maven-plugin:1.0.0:build (default-cli) on project dockerDemo: Exception caught: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: org.apache.http.client.ClientProtocolException: Cannot retry request with a non-repeatable request entity: Connection reset by peer -> [Help 1]

使用的是docker-maven插件,pom.xml配置如下:

<plugin>
	<groupId>com.spotify</groupId>
	<artifactId>docker-maven-plugin</artifactId>
	<version>1.0.0</version>
	<configuration>
		<imageName>${docker.image.prefix}/${project.artifactId}</imageName>
		<dockerDirectory>src/main/docker</dockerDirectory>
		<resources>
			<resource>
				<targetPath>/</targetPath>
				<directory>${project.build.directory}</directory>
				<include>${project.build.finalName}.jar</include>
			</resource>
		</resources>
	</configuration>
</plugin>

解决方法

把要构建的镜像名称全部改为小写,这里配置为<imageName>${docker.image.prefix}/${project.artifactId}</imageName>,所以要保证项目的artifactId为小写。
方案来源:
springboot项目构建docker镜像异常: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded
issue地址:https://github.com/spotify/docker-maven-plugin/issues/357

相关文章:

  • 2021-07-06
  • 2022-12-23
  • 2021-11-28
  • 2021-09-11
  • 2021-09-28
  • 2021-09-10
猜你喜欢
  • 2022-12-23
  • 2021-12-10
  • 2022-12-23
  • 2021-07-05
  • 2022-01-18
  • 2021-06-19
  • 2021-09-12
相关资源
相似解决方案