目录
1.第一次打包时出现:Failed to execute goal com.spotify:docker-maven-plugin:1.0.0:build (build-image) on project server-auth: Exception caught: com.spotify.docker.client.shaded.com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of com.spotify.docker.client.messages.RegistryAuth: no String-argument constructor/factory method to deserialize from String value ('desktop')
检查了自己的配置,发现是打包的插件版本太低了,把version换成1.2.2,这个错误就解决了
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.0.0</version>
</plugin>
2.修正第一次打包问题时,第二次打包时出现:[ERROR] Failed to execute goal com.spotify:docker-maven-plugin:1.2.2:build (build-image) on project server-auth: Exception caught: manifest for java:8 not found: manifest unknown: manifest unknown ed access to the resource is denied -> [Help 1]
看起来是jdk的问题,查阅了多方资料,发现是docker不支持Java镜像,需要用别的镜像替换,把下面的代码换成<baseImage>openjdk:8</baseImage>就行了
<baseImage>java:8</baseImage>