spotify / docker-maven-plugin

INACTIVE: A maven plugin for Docker
Apache License 2.0
2.67k stars 575 forks source link

Failed to execute goal com.spotify:docker-maven-plugin:1.2.0:build #428

Closed kingcode100 closed 5 years ago

kingcode100 commented 5 years ago

Description

When I build docker images, an error occurred.

How to reproduce

mvn package docker:build

What do you expect

What I want to see is normal builde docker images

What happened instead

[ERROR] Failed to execute goal com.spotify:

Software:

Full backtrace

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:00 min
[INFO] Finished at: 2019-07-26T09:54:11+08:00
[INFO] Final Memory: 103M/405M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.spotify:docker-maven-plugin:1.2.0:build (default-cli) on project blade-auth: Exception caught: Request error: GET http://172.24.103.62:2375/version: 200: com.spotify.docker.client.shaded.org.glassfish.jersey.message.internal.MessageBodyProviderNotFoundException: MessageBodyReader not found for media type=text/html, type=class com.spotify.docker.client.messages.Version, genericType=class com.spotify.docker.client.messages.Version. -> [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/MojoExecutionException
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
kingcode100 commented 5 years ago

Key Location of pom.xml

<plugin>
    <groupId>com.spotify</groupId>
    <artifactId>docker-maven-plugin</artifactId>
    <version>${docker.plugin.version}</version>
    <configuration>
        <imageName>${docker.registry.url}/blade/${project.artifactId}:${project.version}</imageName>
        <dockerDirectory>${project.basedir}</dockerDirectory>
        <dockerHost>${docker.registry.host}</dockerHost>
        <resources>
            <resource>
                <targetPath>/</targetPath>
                <directory>${project.build.directory}</directory>
                <include>${project.build.finalName}.jar</include>
            </resource>
        </resources>
        <registryUrl>${docker.registry.url}</registryUrl>
        <serverId>${docker.registry.url}</serverId>
        <pushImage>true</pushImage>
    </configuration>
</plugin>

Key Location of setting.xml

<pluginGroups>
    <pluginGroup>com.spotify</pluginGroup>
</pluginGroups>
kingcode100 commented 5 years ago

Focus on here ERROR] Failed to execute goal com.spotify:docker-maven-plugin:1.2.0:build (default-cli) on project blade-auth: Exception caught: Request error: GET http://172.24.103.62:2375/version: 200: com.spotify.docker.client.shaded.org.glassfish.jersey.message.internal.MessageBodyProviderNotFoundException: MessageBodyReader not found for media type=text/html, type=class com.spotify.docker.client.messages.Version, genericType=class com.spotify.docker.client.messages.Version. -> [Help 1]

kingcode100 commented 5 years ago

可能是因为没有开发2375端口

nellochen commented 4 years ago

请问,最后这个问题怎么解决的?

punkmonday commented 3 years ago

请问,最后这个问题怎么解决的?

看admin的回复是换dockerfile插件 docker部署-执行docker编译命令出错