docker-maven-plugin icon indicating copy to clipboard operation
docker-maven-plugin copied to clipboard

docker:remove does not remove image when multiple tags are available

Open bgrieder opened this issue 9 years ago • 10 comments

When an image is tagged with the project.version and latest , running mvn -Ddocker.removeAll docker:remove only removes the tag with the project.version The image is still available with the latest tag

bgrieder avatar Jun 13 '15 13:06 bgrieder

Cannot reproduce this issue anymore. I (and another colleague) are sometimes left with images "none none" in our docker instance running on boot2docker (OSX). I am unable to explain why the behaviour changed Closing for now

bgrieder avatar Jun 24 '15 12:06 bgrieder

I have the same issue at the moment. So it still exists.

dverbeek84 avatar Sep 04 '15 10:09 dverbeek84

@dverbeek84 what version are you running ?

rhuss avatar Sep 04 '15 11:09 rhuss

jvm: 1.8 docker-maven-plugin: 0.13.3 docker-version: 1.7.1

Clean CentOS 7.1 server running on virtualbox(no boot2docker)

I have set up <removeAll>true</removeAll>

in the debug i see: Executing request DELETE /v1.17/images/snapshot.onegini.com%2Flibrary%2Fbaseimage%3A2.0.1-SNAPSHOT?force=1 this will ony remove the tag

Maybe we can remove the image by ID instead of tag?

dverbeek84 avatar Sep 04 '15 13:09 dverbeek84

Can also confirm.

jvm: 1.8.0_25 maven: 3.2.3 docker-maven-plugin: 0.13.6 docker-client: 1.7.1 docker-server: 1.8.2

I have:

<tags>
    <tag>latest</tag>
    <tag>${project.version}</tag>
</tags>

It removes the first (latest) but not the second (${project.version}) using docker.removeAll

Cheers, Gary

GKTheOne avatar Nov 16 '15 03:11 GKTheOne

Unfortunately, this is still an issue. I am running docker-maven-plugin v0.23.0 with Maven v3.5.0 on Java v1.8.0_151. And similar to the comments above only the first image-tag-tuple is removed. The others are kept. Further, there is <none> image listed when calling docker images.

ghostcity avatar Nov 20 '17 14:11 ghostcity

Shall I specify further details, or provide some pom.xml snippets. However, there won't be nothing new; It is similar to https://github.com/fabric8io/docker-maven-plugin/issues/193#issuecomment-156908026.

ghostcity avatar Nov 20 '17 14:11 ghostcity

I tried to use this functionality today, we use the same

<dockerFileDir>rabbitmq</dockerFileDir>
<tags>
  <tag>latest</tag>
  <tag>${project.version}</tag>
</tags>

format and confirm the tagged version remains. Not so helpful when modifying files ADDed in via the Dockerfile in dockerFileDir

abhsc avatar Nov 30 '17 20:11 abhsc

Is that Bug now resolved? I use the version 0.33.0 and it does not work correct. Only the latest image were deleted, as mentioned before. my config locks like that:

<configuration>
                            <removeMode>all</removeMode>
                            <images>
                                <image>
                                    <name>${docker-image.name}</name>
                                </image>
                            </images>
</configuration>

sabf81 avatar Jun 12 '20 11:06 sabf81

Hello, I am using version 0.34.1 and it works, the image is removed 👍🏼

blackat avatar Feb 02 '21 16:02 blackat