我不确定是否可行,因为我找不到在线可用的资源
我想创建一个maven项目,该项目使用docker maven插件构建一个docker并将构建映像推送到我的gitlab注册表中。
它是一个简单的mysql docker,它将包含我要在集成测试中使用的数据库。
下面是我pom.xml中的docker maven插件
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.4.14</version>
<configuration>
<imageName>pixyfi-db-docker:test-ready</imageName>
<dockerDirectory>src/main</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>resources/test.sql</include>
</resource>
</resources>
<serverId>gitlab</serverId>
<registryUrl>registry.gitlab.com/pixyfi/pixyfi-backend</registryUrl>
</configuration>
<executions>
<execution>
<id>docker-build</id>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
<execution>
<id>push-image</id>
<phase>deploy</phase>
<goals>
<goal>push</goal>
</goals>
<configuration>
<imageName>pixyfi-db-docker:test-ready</imageName>
</configuration>
</execution>
</executions>
</plugin>
我在settings.xml中定义了服务器元素
使用这个我可以在本地创建docker镜像,并且工作正常,但是当我使用mvn clean deploy
进行部署时,它会失败
无法执行目标 org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy pixyfi-db-docker项目上的(default-deploy):无法部署 工件:找不到工件 快照中的com.pixyfi:pixyfi-db-docker:jar:1.0-20190124.030217-1 (http://registry.gitlab.com/pixyfi/pixyfi-backend/pixyfi-db-docker:test-ready)
问题: 我没有在pom.xml中定义包装,因此默认情况下它看起来像是将包装作为jar并尝试部署jar,但为什么它却不尝试部署我的docker映像?
我在这里想念东西吗?