spotify / docker-maven-plugin

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

Bug when I set imageTags #426

Closed tangj1992 closed 5 years ago

tangj1992 commented 5 years ago

Description

Same as #408,it is failed when I set imagTags.

How to reproduce

 <plugin>
                <groupId>com.spotify</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <executions>
                    <execution>
                        <id>build-image</id>
                        <phase>package</phase>
                        <goals>
                            <goal>build</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <dockerHost>http://192.168.8.81:4243</dockerHost>
                    <imageName>192.168.8.81:80/test/plugin</imageName>

                    <serverId>harbor</serverId>
                    <pushImage>true</pushImage>
                    <imageTags>
                        <imageTag>${project.version}</imageTag>
                        <imageTag>latest</imageTag>
                    </imageTags>
                    <forceTags>true</forceTags>
                    <baseImage>openjdk:8-jre-alpine</baseImage>
                    <exposes>
                        <expose>8080</expose>
                    </exposes>
                    <env>
                        <JAVA_OPTS>-Xms128m -Xmx128m</JAVA_OPTS>
                    </env>
                    <entryPoint>["java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /${project.build.finalName}.${project.packaging} "]</entryPoint>
                    <resources>
                        <resource>
                            <targetPath>/</targetPath>
                            <directory>${project.build.directory}</directory>
                            <include>${project.build.finalName}.${project.packaging}</include>
                        </resource>
                    </resources>

                </configuration>
            </plugin>

What do you expect

push to my own harbor only.

What happened instead

It will be push to my harbor and docker.io and will has a null tag more.

Software:

Full backtrace

[INFO] Building image 192.168.8.81:80/test/plugin
Step 1/5 : FROM openjdk:8-jre-alpine

 ---> f7a292bbb70c
Step 2/5 : ENV JAVA_OPTS -Xms128m -Xmx128m

 ---> Using cache
 ---> 4ef305020462
Step 3/5 : ADD /test.jar //

 ---> 0e25733d8766
Step 4/5 : EXPOSE 8080

 ---> Running in 8e70db0eab12
Removing intermediate container 8e70db0eab12
 ---> ba7f538c8498
Step 5/5 : ENTRYPOINT ["java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /test.jar "]

 ---> Running in 8fd2baf1e898
Removing intermediate container 8fd2baf1e898
 ---> 953893b9a0ab
ProgressMessage{id=null, status=null, stream=null, error=null, progress=null, progressDetail=null}
Successfully built 953893b9a0ab
Successfully tagged 192.168.8.81:80/test/plugin:latest
[INFO] Built 192.168.8.81:80/test/plugin
[INFO] Tagging 192.168.8.81:80/test/plugin with 0.0.1
[INFO] Tagging 192.168.8.81:80/test/plugin with latest
[INFO] Pushing 192.168.8.81:80/test/plugin
The push refers to repository [192.168.8.81:80/test/plugin]
865937ae495b: Preparing 
edd61588d126: Preparing 
9b9b7f3d56a0: Preparing 
f1b5933fe4b5: Preparing 
9b9b7f3d56a0: Layer already exists 
865937ae495b: Pushing [>                                                  ]  197.1kB/16.79MB
edd61588d126: Layer already exists 
f1b5933fe4b5: Layer already exists 
865937ae495b: Pushing [=======>                                           ]  2.556MB/16.79MB
865937ae495b: Pushing [==============>                                    ]  4.916MB/16.79MB
865937ae495b: Pushing [=====================>                             ]  7.275MB/16.79MB
865937ae495b: Pushing [============================>                      ]  9.634MB/16.79MB
865937ae495b: Pushing [===================================>               ]  11.99MB/16.79MB
865937ae495b: Pushing [==========================================>        ]  14.35MB/16.79MB
865937ae495b: Pushing [=================================================> ]  16.71MB/16.79MB
865937ae495b: Pushing [==================================================>]  16.79MB
865937ae495b: Pushed 
0.0.1: digest: sha256:bec16865e2551cd7bcfbd1de041b68727336d636c139b33799075f13d92a7772 size: 1159
null: null 
865937ae495b: Preparing 
edd61588d126: Preparing 
9b9b7f3d56a0: Preparing 
f1b5933fe4b5: Preparing 
865937ae495b: Layer already exists 
edd61588d126: Layer already exists 
9b9b7f3d56a0: Layer already exists 
f1b5933fe4b5: Layer already exists 
latest: digest: sha256:bec16865e2551cd7bcfbd1de041b68727336d636c139b33799075f13d92a7772 size: 1159
null: null 
[INFO] Pushing 192.168.8.81:0.0.1
The push refers to repository [docker.io/library/192.168.8.81]
[WARNING] Failed to push 192.168.8.81:80/test/plugin, retrying in 10 seconds (1/5).
[INFO] Pushing 192.168.8.81:80/test/plugin
The push refers to repository [192.168.8.81:80/test/plugin]
865937ae495b: Preparing 
edd61588d126: Preparing 
9b9b7f3d56a0: Preparing 
f1b5933fe4b5: Preparing 
edd61588d126: Layer already exists 
f1b5933fe4b5: Layer already exists 
865937ae495b: Layer already exists 
9b9b7f3d56a0: Layer already exists 
0.0.1: digest: sha256:bec16865e2551cd7bcfbd1de041b68727336d636c139b33799075f13d92a7772 size: 1159
null: null 
865937ae495b: Preparing 
edd61588d126: Preparing 
9b9b7f3d56a0: Preparing 
f1b5933fe4b5: Preparing 
865937ae495b: Layer already exists 
edd61588d126: Layer already exists 
9b9b7f3d56a0: Layer already exists 
f1b5933fe4b5: Layer already exists 
latest: digest: sha256:bec16865e2551cd7bcfbd1de041b68727336d636c139b33799075f13d92a7772 size: 1159
null: null 
[INFO] Pushing 192.168.8.81:0.0.1
The push refers to repository [docker.io/library/192.168.8.81]
[WARNING] Failed to push 192.168.8.81:80/test/plugin, retrying in 10 seconds (2/5).
[INFO] Pushing 192.168.8.81:80/test/plugin
The push refers to repository [192.168.8.81:80/test/plugin]
865937ae495b: Preparing 
edd61588d126: Preparing 
9b9b7f3d56a0: Preparing 
f1b5933fe4b5: Preparing 
f1b5933fe4b5: Layer already exists 
edd61588d126: Layer already exists 
9b9b7f3d56a0: Layer already exists 
865937ae495b: Layer already exists 
0.0.1: digest: sha256:bec16865e2551cd7bcfbd1de041b68727336d636c139b33799075f13d92a7772 size: 1159
null: null 
865937ae495b: Preparing 
edd61588d126: Preparing 
9b9b7f3d56a0: Preparing 
f1b5933fe4b5: Preparing 
865937ae495b: Layer already exists 
edd61588d126: Layer already exists 
9b9b7f3d56a0: Layer already exists 
f1b5933fe4b5: Layer already exists 
latest: digest: sha256:bec16865e2551cd7bcfbd1de041b68727336d636c139b33799075f13d92a7772 size: 1159
null: null 
[INFO] Pushing 192.168.8.81:0.0.1
The push refers to repository [docker.io/library/192.168.8.81]
[WARNING] Failed to push 192.168.8.81:80/test/plugin, retrying in 10 seconds (3/5).
[INFO] Pushing 192.168.8.81:80/test/plugin
The push refers to repository [192.168.8.81:80/test/plugin]
865937ae495b: Preparing 
edd61588d126: Preparing 
9b9b7f3d56a0: Preparing 
f1b5933fe4b5: Preparing 
f1b5933fe4b5: Layer already exists 
9b9b7f3d56a0: Layer already exists 
edd61588d126: Layer already exists 
865937ae495b: Layer already exists 
0.0.1: digest: sha256:bec16865e2551cd7bcfbd1de041b68727336d636c139b33799075f13d92a7772 size: 1159
null: null 
865937ae495b: Preparing 
edd61588d126: Preparing 
9b9b7f3d56a0: Preparing 
f1b5933fe4b5: Preparing 
865937ae495b: Layer already exists 
edd61588d126: Layer already exists 
9b9b7f3d56a0: Layer already exists 
f1b5933fe4b5: Layer already exists 
latest: digest: sha256:bec16865e2551cd7bcfbd1de041b68727336d636c139b33799075f13d92a7772 size: 1159
null: null 
[INFO] Pushing 192.168.8.81:0.0.1
The push refers to repository [docker.io/library/192.168.8.81]
[WARNING] Failed to push 192.168.8.81:80/test/plugin, retrying in 10 seconds (4/5).
The push refers to repository [192.168.8.81:80/test/plugin]
865937ae495b: Preparing 
edd61588d126: Preparing 
9b9b7f3d56a0: Preparing 
f1b5933fe4b5: Preparing 
9b9b7f3d56a0: Layer already exists 
edd61588d126: Layer already exists 
865937ae495b: Layer already exists 
f1b5933fe4b5: Layer already exists 
0.0.1: digest: sha256:bec16865e2551cd7bcfbd1de041b68727336d636c139b33799075f13d92a7772 size: 1159
null: null 
865937ae495b: Preparing 
edd61588d126: Preparing 
9b9b7f3d56a0: Preparing 
f1b5933fe4b5: Preparing 
865937ae495b: Layer already exists 
edd61588d126: Layer already exists 
9b9b7f3d56a0: Layer already exists 
f1b5933fe4b5: Layer already exists 
latest: digest: sha256:bec16865e2551cd7bcfbd1de041b68727336d636c139b33799075f13d92a7772 size: 1159
null: null 
[INFO] Pushing 192.168.8.81:0.0.1
The push refers to repository [docker.io/library/192.168.8.81]
[WARNING] Failed to push 192.168.8.81:80/test/plugin, retrying in 10 seconds (5/5).
[INFO] Pushing 192.168.8.81:80/test/plugin
The push refers to repository [192.168.8.81:80/test/plugin]
865937ae495b: Preparing 
edd61588d126: Preparing 
9b9b7f3d56a0: Preparing 
f1b5933fe4b5: Preparing 
865937ae495b: Layer already exists 
9b9b7f3d56a0: Layer already exists 
f1b5933fe4b5: Layer already exists 
edd61588d126: Layer already exists 
0.0.1: digest: sha256:bec16865e2551cd7bcfbd1de041b68727336d636c139b33799075f13d92a7772 size: 1159
null: null 
865937ae495b: Preparing 
edd61588d126: Preparing 
9b9b7f3d56a0: Preparing 
f1b5933fe4b5: Preparing 
865937ae495b: Layer already exists 
edd61588d126: Layer already exists 
9b9b7f3d56a0: Layer already exists 
f1b5933fe4b5: Layer already exists 
latest: digest: sha256:bec16865e2551cd7bcfbd1de041b68727336d636c139b33799075f13d92a7772 size: 1159
null: null 
[INFO] Pushing 192.168.8.81:0.0.1
The push refers to repository [docker.io/library/192.168.8.81]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:05 min
[INFO] Finished at: 2019-06-21T11:28:09+08:00
[INFO] Final Memory: 43M/524M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.spotify:docker-maven-plugin:1.2.0:build (build-image) on project demo: Exception caught: An image does not exist locally with the tag: 192.168.8.81 -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

Process finished with exit code 1
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.

Lkledu commented 3 years ago

I know that this issue is from 2019, but if anyone has this problem, try to add the tags and inside