如何解决maven docker出错问题-LMLPHP

本文操作环境:centos7系统、docker-maven-plugin 0.4.11版本、Dell G3电脑。

如何解决maven docker出错问题?

maven docker plugin 常见问题解决:

1. maven 项目必须使用小写,不然会一直有500 的错误

500: HTTP 500InternalServerError
登录后复制

2. docker server 连接数超了

Failed to execute goal com.spotify:docker-maven-plugin:0.4.11:build (default-cli) on project activityservice:Exception caught: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: java.io.IOException:No such file or directory
登录后复制

解决方法:

最简单的方法, 重启docker 服务

systemctl restart docker
登录后复制

3. maven 账户配置问题

<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.4.11</version>
<configuration>
<imageName>XXXXXXXXXX/activitycenter/${project.artifactId}</imageName>
<imageTags>activitycenter-${project.version}</imageTags>
<dockerDirectory>src/main/docker</dockerDirectory>
<serverId>docker-image</serverId>
<useConfigFile>true</useConfigFile>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
登录后复制

serverId docker-image 配置信息账户信息:

<server>
<id>docker-image</id>
<username>admin</username>
<password>XXXXX</password>
<configuration>
<email>XXXXXX@XXXXXX.com</email>
</configuration>
</server>
登录后复制

注意其中 email 的配置

推荐学习:《docker教程

以上就是如何解决maven docker出错问题的详细内容,更多请关注Work网其它相关文章!

09-12 11:52