[英]spring boot maven plugin build-image is not working
I created demo project from start.spring.io with spring boot version 3.0.1 and java version 17.我使用 spring 引导版本 3.0.1 和 java 版本 17 从 start.spring.io 创建了演示项目。
I tried to execute below command on terminal to build Docker image我尝试在终端上执行以下命令来构建 Docker 图像
mvn spring-boot:build-image -Dspring-boot.build-image.imageName=testtesttest
It resulted in error结果出错
[INFO] [creator] $BPL_JVM_THREAD_COUNT 250 the number of threads in memory calculation
[INFO] [creator] $JAVA_TOOL_OPTIONS the JVM launch flags
[INFO] [creator] Using Java version 18 extracted from MANIFEST.MF
[INFO] [creator] No valid JRE available, providing matching JDK instead. Using a JDK at runtime has security implications.
[INFO] [creator] : Contributing to layer
[INFO] [creator] Warning: Dependency has no SHA256. Skipping cache.
[INFO] [creator] Downloading from
[INFO] [creator] unable to invoke layer creator
[INFO] [creator] unable to get dependency
[INFO] [creator] unable to download
[INFO] [creator] unable to request
[INFO] [creator] Get "": unsupported protocol scheme ""
[INFO] [creator] ERROR: failed to build: exit status 1
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.756 s
[INFO] Finished at: 2023-01-02T15:18:19+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:3.0.1:build-image (default-cli) on project demo: Execution default-cli of goal org.springframework.boot:spring-boot-maven-plugin:3.0.1:build-image failed: Builder lifecycle 'creator' failed with status code 51 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
I am using openjdk (version "18.0.2" 2022-07-19) on mac.我在 mac 上使用 openjdk(版本“18.0.2”2022-07-19)。 Not able to figure it out.
想不通。 Can you please help.
你能帮忙吗?
Looks like the default image builder doesn't yet support Mac M1 processor.看起来默认的图像生成器还不支持 Mac M1 处理器。 I had to add an alternative builder for maven plugin in my pom.xml as shown below:
我必须在我的 pom.xml 中为 maven 插件添加一个替代构建器,如下所示:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<image>
<builder>dashaun/builder:tiny</builder>
</image>
</configuration>
</plugin>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.