Open lin-mt opened 10 months ago
@lin-mt : Do you get some error while plugin is building image? Default behavior is to try cleaning up dangling images. Have you specified cleanup
configuration option via plugin configuration?
@lin-mt : Do you get some error while plugin is building image? Default behavior is to try cleaning up dangling images. Have you specified
cleanup
configuration option via plugin configuration?
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.43.4</version>
<configuration>
<images>
<image>
<name>docker-application:${project.version}</name>
<build>
<dockerFileDir>${project.basedir}</dockerFileDir>
</build>
</image>
<image>
<name>docker-application:latest</name>
<build>
<dockerFileDir>${project.basedir}</dockerFileDir>
</build>
</image>
</images>
</configuration>
</plugin>
this is my config. and I run this task:
This is log.
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------< cn.linmt:application-service >------------------
[INFO] Building application-service 1.0.0
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- docker:0.43.4:build (default-cli) @ application-service ---
[INFO] Building tar: C:\Users\linmt\IdeaProjects\application\application-service\target\docker\docker-application\1.0.0\tmp\docker-build.tar
[INFO] DOCKER> [docker-application:1.0.0]: Created docker-build.tar in 2 seconds
[INFO] DOCKER> [docker-application:1.0.0]: Built image sha256:289c2
[INFO] DOCKER> docker-application:1.0.0: Removed dangling image sha256:d6a3a
[INFO] Building tar: C:\Users\linmt\IdeaProjects\application\application-service\target\docker\docker-application\latest\tmp\docker-build.tar
[INFO] DOCKER> [docker-application:latest]: Created docker-build.tar in 1 second
[INFO] DOCKER> [docker-application:latest]: Built image sha256:289c2
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 28.682 s
[INFO] Finished at: 2023-11-27T09:20:39+08:00
[INFO] ------------------------------------------------------------------------
[WARNING]
[WARNING] Plugin validation issues were detected in 1 plugin(s)
[WARNING]
[WARNING] * io.fabric8:docker-maven-plugin:0.43.4
[WARNING]
[WARNING] For more or less details, use 'maven.plugin.validation' property with one of the values (case insensitive): [BRIEF, DEFAULT, VERBOSE]
[WARNING]
Process finished with exit code 0
It doesn't seem to remove dangling image with the latest tag.
Updating the maven version to 3.9.8 solved the issue for us
Description
if
Dockerfile
like this, after rundocker:build
, it can't auto clean all dangling iamges.Info
mvn -v
) :docker -v
: