Willam Marston
Willam Marston

Reputation: 97

Cannot build Docker image using spotify plugin

I have been using spotify plug-in to build docker images, but it suddenly stops working for some reason, and it spews out error complaining about exec failure on spotify plug-in

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

My pom.xml plug-in is very simple, and maven project build and package is ok

<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>

Upvotes: 0

Views: 2708

Answers (2)

Borg
Borg

Reputation: 11

Using that library you can't use respository names with uppercase. Only [a-z0-9-_.] are allowed.

So change

SimpleWebApp

to

simple-web-app

or something similar.

Upvotes: 1

Jiujiu
Jiujiu

Reputation: 180

Following the line:

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

It seems you are using UNIX as operating system and Docker answers you an error 500.

I'm using MACOS and It works perfectly for me with the same configuration as yours but before I need to evaluation Docker environment variables in my terminal with:

eval $(docker-machine env default)

Upvotes: 2

Related Questions