jkube: Pull registry is not getting authenticated
Describe the bug
<sever> authentication in settings.xml doesn’t work for pullregistry.
Also using docker login is not respected with pullregistry (settings.xml without server section).
I have two separate docker registries. One for pull (dockerhub proxy) and one for push.
Case 1. jkube doesn’t respect settings.xml configuration
settings.xml
<settings>
<servers>
<server>
<id>my.proxy</id>
<username>user</username>
<password>pass</password>
</server>
</servers>
</settings>
Dockerfile
FROM my.proxy/openjdk:17
# rest of the file
I noticed that everything works as expected when I set server id to docker.io Case 2. After logging via docker login to my.proxy I’m getting unauthorized exception.
Eclipse JKube version
1.10.0
Component
Kubernetes Maven Plugin
Apache Maven version
3.8.1
Gradle version
No response
Steps to reproduce
- Set settings.xml
<settings>
<servers>
<server>
<id>my.proxy</id>
<username>user</username>
<password>pass</password>
</server>
</servers>
</settings>
- Set docker file Dockerfile
FROM my.proxy/openjdk:17
- Set pull registry in pom:
<plugin>
<groupId>org.eclipse.jkube</groupId>
<artifactId>kubernetes-maven-plugin</artifactId>
<version>1.10.1</version>
<configuration>
<pullregistry>my.proxy</pullregistry>
</configuration>
Expected behavior
Image is being downloaded from registry.
Runtime
Kubernetes (vanilla)
Kubernetes API Server version
other (please specify in additional context)
Environment
macOS
Eclipse JKube Logs
Error while trying to build the image: Unable to pull 'my.proxy/openjdk:17' : {"message":"Head \"https://my.proxy/v2/openjdk/manifests/17\": unknown: Authentication is required"} (Internal Server Error: 500) -> [Help 1]
Sample Reproducer Project
No response
Additional context
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 28 (28 by maintainers)
Commits related to this issue
- #1929 Fixed parsing image name — committed to balbusm/jkube by balbusm a year ago
- #1929 Formatter changes — committed to balbusm/jkube by balbusm a year ago
- #1929 Formatter changes — committed to balbusm/jkube by balbusm a year ago
- #1929 Fixed parsing image name — committed to balbusm/jkube by balbusm a year ago
- #1929 Formatter changes — committed to balbusm/jkube by balbusm a year ago
- [#1929] Formatter changes — committed to balbusm/jkube by balbusm a year ago
- #1929 Fixed parsing image name Signed-off-by: balbusm <balbusm@gmail.com> — committed to balbusm/jkube by balbusm a year ago
- #1929 Formatter changes Signed-off-by: balbusm <balbusm@gmail.com> — committed to balbusm/jkube by balbusm a year ago
- [#1929] Formatter changes Signed-off-by: balbusm <balbusm@gmail.com> — committed to balbusm/jkube by balbusm a year ago
- Fix #1929: Fixed broken tests — committed to balbusm/jkube by balbusm a year ago
- Fix #1929: Fixed broken tests Signed-off-by: balbusm <balbusm@gmail.com> — committed to balbusm/jkube by balbusm a year ago
- Fix #1929: Fixed broken tests — committed to balbusm/jkube by balbusm a year ago
- Fix #1929: Fixed broken tests Signed-off-by: balbusm <balbusm@gmail.com> — committed to balbusm/jkube by balbusm a year ago
- Fix #1929: Using dot to discriminate user/registry — committed to balbusm/jkube by balbusm a year ago
- Fix #1929 Fixed parsing image name Signed-off-by: balbusm <balbusm@gmail.com> Signed-off-by: balbusm <balbusm@gmail.com> [#1929] Formatter changes Signed-off-by: balbusm <balbusm@gmail.com> Fix #... — committed to balbusm/jkube by balbusm a year ago
- Fix #1929 Fixed parsing image name Signed-off-by: balbusm <balbusm@gmail.com> — committed to balbusm/jkube by balbusm a year ago
- Fix #1929 Fixed parsing image name Signed-off-by: balbusm <balbusm@gmail.com> — committed to rohanKanojia/jkube by balbusm a year ago
- Fix #1929 Fixed parsing image name Signed-off-by: balbusm <balbusm@gmail.com> — committed to balbusm/jkube by balbusm a year ago
- Fix #1929 Fixed parsing image name Signed-off-by: balbusm <balbusm@gmail.com> — committed to balbusm/jkube by balbusm a year ago
- Fix #1929 Fixed parsing image name Signed-off-by: balbusm <balbusm@gmail.com> — committed to rohanKanojia/jkube by balbusm a year ago
@manusa I’m usually have some spare time on Friday. Let me know if there is any Friday that fits you.
I’m pulling from jfrog and pushing to local nexus.
Let’s simplify a scenario. I have one custom repository to pull and push images. Push config works as one would expect:
docker login my.repois executedIn both cases push works. So I would expect if I try to pull image during a docker build above cases would work. However: If I try to build docker file with
FROM my.repo/my-imagejkube is not able to pull image. I have to add second entry to the settings.xml:I login with
docker login my.reponohttps://my.repo.