使用dockerfile-maven-plugin插件打包Docker镜像时,不要从远程仓库中拉取,而是直接使用本地镜像:
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<configuration>
<pullNewerImage>false</pullNewerImage>
<repository>${docker.image.prefix}/kjc/${project.artifactId}</repository>
<buildArgs>
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
</configuration>
</plugin>