当我使用docker-maven-plugin时,我遇到了一个问题: 我的pom.xml的一部分看起来像:
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.4.13</version>
<executions>
<execution>
<id>build-image</id>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
<configuration>
<imageName>${full.image.name}</imageName>
<!-- optionally overwrite tags every time image is built with docker:build -->
<forceTags>true</forceTags>
<imageTags>
<imageTag>${demo.image.tag}</imageTag>
<!--<imageTag>latest</imageTag>-->
</imageTags>
<dockerDirectory>${project.basedir}/docker</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
<buildArgs>
<HTTP_PROXY>${http.proxy}</HTTP_PROXY>
<HTTPS_PROXY>${https.proxy}</HTTPS_PROXY>
<!--<VERSION>${demo.image.version}</VERSION>-->
<!--<BUILD_NUMBER>${build.num}</BUILD_NUMBER>-->
</buildArgs>
</configuration>
</execution>
</executions>
</plugin>
当我执行命令&#34; mvn clean install&#34;时,我是否添加最新版本。或者&#34; mvn clean install -DimageTag = 1.0&#34;(通过猜测),它将构建两个图像:1.0和最新,最新的标签不是我想要的。我只想要1.0,这是由$ {demo.image.tag}定义的。所以&#34;最新的评论&#34;不起作用。我该如何解决这个问题?
那么有人可以帮助我吗?非常感谢。