简体   繁体   English

spring 引导 maven 插件构建映像不工作

[英]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.

相关问题 在插件 org.springframework.boot:spring-boot-maven-plugin 中找不到目标“build-image”: - Could not find goal 'build-image' in plugin org.springframework.boot:spring-boot-maven-plugin: 如何在 Spring boot build-image maven 插件生成的 docker 镜像上设置编码 - How to set encoding on docker image generated by Spring boot build-image maven plugin 突然 spring-boot-maven-plugin:2.7.1:build-image 无法下载 spring-cloud-bindings - Suddenly spring-boot-maven-plugin:2.7.1:build-image could not download spring-cloud-bindings 如何将 spring 引导 maven 插件构建映像与 skaffold 和 dekorate 一起使用? - How do I use spring boot maven plugin build-image with skaffold and dekorate? spring-boot-maven-plugin:build-image 失败并出现 400 Bad Request - spring-boot-maven-plugin:build-image fails with 400 Bad Request 当我触发构建映像目标时,spring-boot-maven-plugin 再次重新运行完整构建周期的原因是什么? - What is the reason that the spring-boot-maven-plugin reruns a full build cycle again when I trigger the build-image goal? 安装了 Npm 的 Spring Boot 构建映像 - Spring Boot build-image with Npm installed 构建 docker 镜像时出错,无法在项目上执行目标 org.springframework.boot:spring-boot-maven-plugin:2.5.2:build-image (default-cli) - Error while building docker image, Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.5.2:build-image (default-cli) on project 在 spring-boot:build-image 中通过命令行传递 dockerPublisher maven 属性 - Pass dockerPublisher maven properties over command line in spring-boot:build-image spring-boot:在代理后面构建映像 - spring-boot:build-image behind a proxy
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM