spotify / docker-maven-plugin

INACTIVE: A maven plugin for Docker
Apache License 2.0
2.67k stars 575 forks source link

Bug when pushing imageTags #408

Closed genuss closed 5 years ago

genuss commented 6 years ago

Description

PR #387 introduced a regression which comes in rare situation like mine. The push of them will not work for a private registry with port but without explicit tag (implicit latest).

How to reproduce

Use this config

<plugin>
    <groupId>com.spotify</groupId>
    <artifactId>docker-maven-plugin</artifactId>
    <version>1.2.0</version>
    <configuration>
        <imageName>private.registry.com:1234/image</imageName>
        <imageTags>
            <imageTag>${project.version}</imageTag>
        </imageTags>
...
</plugin>

And run mvn com.spotify:docker-maven-plugin:1.2.0:push

What do you expect

Plugin pushes private.registry.com:1234/image:latest, private.registry.com:1234/image:project-version

What happened instead

Latest is pushed, but the tagged version cannot be pushed because plugin tries to push private.registry.com:project-version, which is supposed to be on docker hub. I suppose the bug is here: https://github.com/spotify/docker-maven-plugin/blob/master/src/main/java/com/spotify/docker/Utils.java#L126

Software:

Workaround

Specify latest tag explicitly like this:

<plugin>
    <groupId>com.spotify</groupId>
    <artifactId>docker-maven-plugin</artifactId>
    <version>1.2.0</version>
    <configuration>
        <imageName>private.registry.com:1234/image:latest</imageName>
        <imageTags>
            <imageTag>${project.version}</imageTag>
        </imageTags>
...
</plugin>
stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.