Closed QingLea closed 5 years ago
I'm experiencing the same issue.
I'm not seeing where in the output it shows that the image is being pushed to docker.io:
Pushing monoy.cn:5000/crypto-watch-dog-demo
The push refers to repository [monoy.cn:5000/crypto-watch-dog-demo]
could you clarify that bit?
@mattnworb right after pushing to private repository it tries to push to docker.io It clearly visible in last 3 lines in output posted by @fatcats
[INFO] Pushing monoy.cn:0.0.2
The push refers to repository [docker.io/library/monoy.cn]
[WARNING] Failed to push monoy.cn:5000/crypto-watch-dog-demo, retrying in 10 seconds (1/5)
@mattnworb in last 3lines
[INFO] Pushing monoy.cn:0.0.2
The push refers to repository [docker.io/library/monoy.cn]
[WARNING] Failed to push monoy.cn:5000/crypto-watch-dog-demo, retrying in 10 seconds (1/5).
@zhabba I edited my pom file like this to avoid this issue
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>1.2.0</version>
<configuration>
<imageName>${my.docker.registry.host}/${project.name}:${project.version}</imageName>
<imageTags>
<imageTag>latest</imageTag>
</imageTags>
<baseImage>openjdk:alpine</baseImage>
<entryPoint>["java", "-jar", "/${project.build.finalName}.jar"]</entryPoint>
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.build.finalName}.jar</include>
</resource>
</resources>
</configuration>
<executions>
<execution>
<id>build-docker-image</id>
<phase>package</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
<execution>
<id>push-docker-image</id>
<phase>package</phase>
<goals>
<goal>push</goal>
</goals>
</execution>
</executions>
<imageName>${my.docker.registry.host}/${project.name}:${project.version}</imageName>
I found that if i added my project version behind image name could avoid this issue.
I do not know this issue is a feature or a bug. Do I must set my image version to avoid it push my image to docker.io? @mattnworb
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.
I has the same issue. I see the source code :
if (pushImageTag) {
pushImageTag(docker, imageName, imageTags, getLog(), isSkipDockerPush());
}
if (pushImage) {
pushImage(docker, imageName, imageTags, getLog(), buildInfo, getRetryPushCount(),
getRetryPushTimeout(), isSkipDockerPush());
}
pushImageTag will call this method
private static String getImageNameWithNoTag(String imageName) {
final int tagSeparatorIndex = imageName.lastIndexOf(':');
if (tagSeparatorIndex >= 0) {
imageName = imageName.substring(0, tagSeparatorIndex);
}
return imageName;
}
if use pushImage parameter ,the image will push to docker.io/library and retry. so my solution is not use pushImage。 only use pushImageTag。
Description
I am using private registry and when i use you plugin to push images to private registry ,but it always trying push to docker.io/library after private registry pushing was finished Here is part of my pom.xml
IDEA LOGS
look the end of log , I am wandering that how it happened , Does my pom.xml setting incorrect? looking forward your reply, thank you!