Skip to content
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

Jib pull base image from public registry and push to private registry #8498

Closed
jorsol opened this issue Apr 9, 2020 · 2 comments · Fixed by #8501
Closed

Jib pull base image from public registry and push to private registry #8498

jorsol opened this issue Apr 9, 2020 · 2 comments · Fixed by #8501
Assignees
Labels
area/container-image kind/bug Something isn't working
Milestone

Comments

@jorsol
Copy link
Contributor

jorsol commented Apr 9, 2020

Describe the bug
Building an image with the container-jib extension fails, if the base image is hosted in a public registry and the properties quarkus.container-image.username and quarkus.container-image.password are set to push on a different private registry.

This is a regression from #8288.

Expected behavior
Build image from the public registry, and push the image to a different private registry.

Actual behavior

20695 [ERROR] Caused by: com.google.cloud.tools.jib.api.RegistryAuthenticationFailedException: Failed to authenticate with registry registry-1.docker.io/azul/zulu-openjdk because: 401 Unauthorized
20695 [ERROR] {"details":"incorrect username or password"}
20695 [ERROR] 
20695 [ERROR] 	at com.google.cloud.tools.jib.registry.RegistryAuthenticator.authenticate(RegistryAuthenticator.java:306)
20695 [ERROR] 	at com.google.cloud.tools.jib.registry.RegistryAuthenticator.authenticate(RegistryAuthenticator.java:258)
20696 [ERROR] 	at com.google.cloud.tools.jib.registry.RegistryAuthenticator.authenticatePull(RegistryAuthenticator.java:177)
20696 [ERROR] 	at com.google.cloud.tools.jib.registry.RegistryClient.doBearerAuth(RegistryClient.java:362)
20696 [ERROR] 	at com.google.cloud.tools.jib.registry.RegistryClient.doPullBearerAuth(RegistryClient.java:327)
20696 [ERROR] 	at com.google.cloud.tools.jib.builder.steps.PullBaseImageStep.call(PullBaseImageStep.java:158)
20696 [ERROR] 	at com.google.cloud.tools.jib.builder.steps.PullBaseImageStep.call(PullBaseImageStep.java:56)
20697 [ERROR] 	at com.google.common.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
20697 [ERROR] 	at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:57)
20697 [ERROR] 	at com.google.common.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
20697 [ERROR] 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
20697 [ERROR] 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
20698 [ERROR] 	at java.base/java.lang.Thread.run(Thread.java:832)

To Reproduce
Steps to reproduce the behavior:

  1. Set quarkus.jib.base-jvm-image=docker.io/azul/zulu-openjdk:14
  2. Set quarkus.container-image.registry=registry.gitlab.com, quarkus.container-image.group and quarkus.container-image.name.
  3. ./mvnw package -Dquarkus.container-image.push=true -Dquarkus.container-image.username=REGISTRY_USER -Dquarkus.container-image.password=REGISTRY_PASSWORD

Configuration

quarkus.jib.base-jvm-image=docker.io/azul/zulu-openjdk:14
quarkus.container-image.registry=registry.gitlab.com
quarkus.container-image.group=org/group
quarkus.container-image.name=project

Environment (please complete the following information):

  • Output of java -version: openjdk version "14" 2020-03-17
  • Quarkus version or git rev: 1.3.2.Final
  • Build tool (ie. output of mvnw --version or gradlew --version): Apache Maven 3.6.3

Additional context
The public base image is set to docker.io explicitly (it's the default if not set), the quarkus.container-image.registry is set to registry.gitlab.com, since both registries are different one approach is to detect if they are the same to authenticate using the container-image properties.

Thinking more on this, if both registries are different (both private) the best would be to provide another set of permissions (user/pass) to be used by Jib to pull and push.

@jorsol jorsol added the kind/bug Something isn't working label Apr 9, 2020
@gsmet
Copy link
Member

gsmet commented Apr 9, 2020

/cc @iocanel @geoand

@geoand
Copy link
Contributor

geoand commented Apr 9, 2020

Yes, we need another set of username/password, otherwise we can't make it work properly.

I will fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/container-image kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants