docker maven 出错:Failed to execute goal com.spotify:docker-maven-plugin:...: Request error: POST http

Posted 火光闪耀

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了docker maven 出错:Failed to execute goal com.spotify:docker-maven-plugin:...: Request error: POST http相关的知识,希望对你有一定的参考价值。

Spring Boot项目构建docker镜像,出错Failed to execute goal com.spotify:docker-maven-plugin:0.4.13:build (default-cli) on project SpringBoot2: Exception caught: Request error: POST https://192.168.99.100:2376/build?t=mytest/SpringBoot2: 500: HTTP 500 Internal Server Error

出现这个错的原因确实出人意料——居然是因为大小写问题...

我是在pom.xml里加入了docker构建用的插件:

      <plugin>
                <groupId>com.spotify</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <version>0.4.13</version>
                <configuration>
<!--                     <imageName>${docker.image.prefix}/${project.artifactId}</imageName> 这里取得是项目名字,我的项目名字是SpringBoot2,导致失败-->
                    <imageName>mytest/springboottest</imageName>
<!--                     <dockerDirectory>src/main/docker</dockerDirectory> -->
                    <dockerDirectory>./</dockerDirectory>
                    <resources>
                        <resource>
                            <targetPath>/</targetPath>
                            <directory>${project.build.directory}</directory>
                            <include>${project.build.finalName}.jar</include>
                        </resource>
                    </resources>
                </configuration>
            </plugin>

 

构建方式,请参考:http://spring.io/guides/gs/spring-boot-docker/

 

以上是关于docker maven 出错:Failed to execute goal com.spotify:docker-maven-plugin:...: Request error: POST http的主要内容,如果未能解决你的问题,请参考以下文章

maven 编译出错 Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean

maven 编译出错 Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean

maven 编译出错 Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean

Failed to execute goal com.spotify:docker-maven-plugin:1.0.0:build (build-image) on project training

pom.xml文件project报错Failed to read artifact descriptor forXXX:jar:unknow,导致idea导入项目时maven依赖没有加载进项目的问题

基于WSL2 的 Docker Desktop 启动时 Failed to set version to docker-desktop exit code -1的解决方法