-
Notifications
You must be signed in to change notification settings - Fork 41.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image building does not validate that image registry host matches publish registry URL #29281
Comments
You haven't provided a domain when specifying the image name so it defaults to I wonder if we can make this easier. It'd be nice to not have to duplicate the domain in the image name and in the publish registry URL. |
@wilkinsona I'm not sure if there are additional jobs to track, so I leave this issue as "open". It can be closed if necessary. |
The Another option would be to do more validation to ensure that the registry part of the built image and the host part of the registry URL match before attempting to push an image. If additional tags are applied to the built image, and publishing is requested in the build configuration, it is also required that all image tags have the same registry part. We should probably validate that this is the case before publishing also. |
The documentation should also clarify that the value of #31820 has been created to cover the documentation change. |
If I read the code correctly, Looking at the docs, it says:
I find the When setting this to some bogus value, the image is pushed to the registry with the credentials from |
What registry did you test with? It's been a while since I've looked at this, but IIRC the value is inspected by the registry server, and it's possible that different registries handle it differently. If that's the case, we might want to clarify that in the documentation. |
Hi Scott! I've tested with https://hub.docker.com/_/registry. I've thought the Docker Engine inspect that header and then either pass the credentials to the registry or it doesn't if it doesn't match. But i haven't checked the source code. |
hello,
Envronment:
System: Windows 10 Home x64 21H2
JDK: 11.0.13
Spring Boot: 2.6.2
Docker Desktop 4.3.2 (WSL 2 based)
We built a private docker repositories with Sonatype Nexus at
http://172.2.3.5:9000/
.Try build image for a simple Spring REST WebApp.
build.gradle
Run
.\gradlew.bat bootBuildImage
, got outputs like:Notice that the red lines always output 'docker.io/' even if 'docker.publishRegistry.url' is specified, so I guess the task might try to push the image to ‘docker.io’ instead of '172.2.3.5:9000', and it fails.
Please let me know if there is any misunderstanding, thank you.
The text was updated successfully, but these errors were encountered: