在pom.xml中,我已定义:
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>1.0.0</version>
<configuration>
<imageName>${docker.image.name}:${docker.image.tag}</imageName>
<dockerDirectory>${basedir}/target/dockerfile</dockerDirectory>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.war</include>
</resource>
</resources>
</configuration>
</plugin>
当我跑步时:
docker ps -a
似乎一切正常:
697e4e483ba5 localhost:5000/my-app:latest "sh -c 'java $JAVA_O…" 3 hours ago Up 3 hours 0.0.0.0:9006->9006/tcp my-app.1rb406ind3ue1ubb8kzhuaht6.av4yn057f9ata2n2sdslkuwfs
但是当我跑步时:
docker images -a
我可以看到TAG:
localhost:5000/my-app <none> ab6ac08baa3a 4 minutes ago 552MB
localhost:5000/my-app <none> 17acdee85fe9 3 hours ago 549MB
这样可以吗?如何在图像中添加最新标签?