不能使用Spotify插件来构buildDocker镜像

我一直在使用Spotify插件来构buildDocker镜像,但由于某种原因,它突然停止工作,并且发出错误,抱怨Spotify插件上的exec失败

[INFO] [INFO] --- maven-jar-plugin:2.5:jar (default-jar) @ SimpleWebApp --- [INFO] Building jar: /home/test/opd_workspace/my_simple_webapp/target/SimpleWebApp-0.0.1-SNAPSHOT.jar [INFO] [INFO] --- spring-boot-maven-plugin:1.3.5.RELEASE:repackage (default) @ SimpleWebApp --- [INFO] [INFO] --- docker-maven-plugin:0.2.3:build (default-cli) @ SimpleWebApp --- SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details. [INFO] Copying /home/test/opd_workspace/my_simple_webapp/target/SimpleWebApp-0.0.1-SNAPSHOT.jar -> /home/test/opd_workspace/my_simple_webapp/target/docker/SimpleWebApp-0.0.1-SNAPSHOT.jar [INFO] Copying src/main/docker/Dockerfile -> /home/test/opd_workspace/my_simple_webapp/target/docker/Dockerfile [INFO] Building image imgprefix/SimpleWebApp [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 5.282s [INFO] Finished at: Wed Jun 01 19:42:14 EDT 2016 [INFO] Final Memory: 27M/340M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal com.spotify:docker-maven-plugin:0.2.3:build (default-cli) on project SimpleWebApp: Exception caught: Request error: POST unix://localhost:80/v1.12/build?t=imgprefix/SimpleWebApp: 500: HTTP 500 Internal Server Error -> [Help 1] 

我的pom.xml插件非常简单,而且maven项目的构build和打包是可以的

 <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> <plugin> <groupId>com.spotify</groupId> <artifactId>docker-maven-plugin</artifactId> <version>0.2.3</version> <configuration> <imageName>${docker.image.prefix}/${project.artifactId}</imageName> <dockerDirectory>src/main/docker</dockerDirectory> <resources> <resource> <targetPath>/</targetPath> <directory>${project.build.directory}</directory> <include>${project.build.finalName}.jar</include> </resource> </resources> </configuration> </plugin> </plugins> 

继线:

 [ERROR] Failed to execute goal com.spotify:docker-maven-plugin:0.2.3:build (default-cli) on project SimpleWebApp: Exception caught: Request error: POST unix://localhost:80/v1.12/build?t=imgprefix/SimpleWebApp: 500: HTTP 500 Internal Server Error -> [Help 1] 

看来你使用UNIX作为操作系统,而Docker你一个错误500。

我正在使用MACOS ,它完全适合我,与您的configuration相同,但是在我需要在terminal中评估Docker环境variables之前:

 eval $(docker-machine env default) 

使用该库,不能使用大写的存储库名称。 只允许[a-z0-9-_。]。

所以改变

SimpleWebApp

简单web应用程序

或类似的东西。