-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 native build failures when setting custom 'quarkus.jib.base-native-image' values #19744
Comments
/cc @geoand |
I tried this and was not able to reproduce the problem... Everything worked as expected |
I wanted to make sure it wasn't something specific with my project, so I created a brand new project using the quarkus-maven-plugin (https://quarkus.io/guides/rest-json#creating-the-maven-project) and added JIB to the pom:
This still produced the following stack trace for me
I think the key component is adding the Sample output from running:
Is the |
You are completely right. I see the problem now. Thanks for the details! |
#19780 fixes the problem |
Use the proper config values when pulling base image for native build using Jib
Describe the bug
Building a native image with the container-jib extension throws a
com.google.cloud.tools.jib.api.RegistryAuthenticationFailedException
when the value of thequarkus.jib.base-native-image
property is set to anything OTHER than images hosted onregistry.access.redhat.com
.I recently discovered this when attempting to use docker-hub distributed images of
ubi8-minimal
(for various reasons), i.e. instead of settingquarkus.jib.base-native-image=registry.access.redhat.com/ubi8/ubi-minimal:8.4
(which does work) I set the property toquarkus.jib.base-native-image=redhat/ubi8-minimal:8.4
This also may be related to #8498
NOTE: This failure does not occur when building in JVM mode. I can freely use
docker.io
images when building in JVM mode.Expected behavior
Build a native executable image using docker hub distributed images as the native image's base image.
Actual behavior
Upon executing the following (CI pipeline replaces all env vars with proper values):
I get the following stack trace (note that the actual GraalVM compilation is successful):
Also note that when executing the same command but using
-Dquarkus.jib.base-native-image=registry.access.redhat.com/ubi8/ubi-minimal:8.4
it functions properly:How to Reproduce?
quarkus.jib.base-native-image=redhat/ubi8-minimal:8.4
mvn clean package -Pnative -Dquarkus.container-image.build=true -Dquarkus.container-image.tag=$VERSION-native -Dquarkus.container-image.username=$USER_CREDENTIALS_USR -Dquarkus.container-image.password=$USER_CREDENTIALS_PSW -Dquarkus.container-image.registry=$REGISTRY_URL -Dquarkus.container-image.push=true -Dquarkus.jib.base-native-image=redhat/ubi8-minimal:8.4
Configuration
quarkus.application.name=project
quarkus.banner.enabled = false
quarkus.container-image.group=org/group
quarkus.native.native-image-xmx=4096m
quarkus.native.additional-build-args=--initialize-at-run-time=org.apache.activemq.util.IdGenerator
quarkus.camel.bootstrap.enabled=false
quarkus.camel.main.enabled=false
quarkus.camel.routes-discovery.enabled=false
quarkus.camel.runtime-catalog.components=false
quarkus.camel.runtime-catalog.languages=false
quarkus.camel.runtime-catalog.dataformats=false
quarkus.camel.runtime-catalog.models=false
quarkus.jackson.fail-on-unknown-properties=false
quarkus.elasticsearch.health.enabled=false
quarkus.elasticsearch.hosts=${ES_HOSTS}
quarkus.elasticsearch.protocol=http
quarkus.log.level=INFO
quarkus.log.console.format=%d{HH:mm:ss} %-5p [%c{2.}] (%t) %s%e%n
quarkus.log.console.color=false
quarkus.log.category."org.apache.activemq".level=INFO
quarkus.log.category."org.apache.camel.component".level=INFO
quarkus.log.category."org.apache.camel.impl".level=INFO
quarkus.log.category."or.ap.ht".level=INFO
quarkus.log.category."org.elasticsearch".level=INFO
Output of
uname -a
orver
Linux e6d5e3d1a507 3.10.0-1127.el7.x86_64 #1 SMP Tue Mar 31 23:36:51 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
openjdk version "11.0.12" 2021-07-20 OpenJDK Runtime Environment GraalVM CE 21.2.0 (build 11.0.12+6-jvmci-21.2-b08) OpenJDK 64-Bit Server VM GraalVM CE 21.2.0 (build 11.0.12+6-jvmci-21.2-b08, mixed mode, sharing)
GraalVM version (if different from Java)
21.2.0
Quarkus version or git rev
2.1.4.Final (also same failures on 1.13.2.FINAL)
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
Additional information
Also note, that this is being built in my CI pipeline using the image
quay.io/quarkus/centos-quarkus-maven:21.2-java11
(the environment fields were filled using that container's information. I should note that the image is able to build container images since the underlying CI builder node is using a docker agent to launch the container, so I believe JIB inside the container uses that to build the images (working theory at least).This is only a hunch, but I wonder if JIB is attempting to send an authenticated pull (instead of anonymous) to docker hub, and the API doesn't like it, whereas the RedHat registry doesn't care? If this is the case, I would like to propose that if
quarkus.jib.base-registry-username
&quarkus.jib.base-registry-password
are not set (which is currently default), then it should only attempt an anonymous pull.I have however been able to reproduce it on my local machine using the following condensed environment:
Local Environment
uname -a
orver
:Linux workstation 3.10.0-1127.18.2.el7.x86_64 #1 SMP Sun Jul 26 15:27:06 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
java -version
:openjdk version "11.0.11" 2021-04-20 LTS OpenJDK Runtime Environment 18.9 (build 11.0.11+9-LTS) OpenJDK 64-Bit Server VM 18.9 (build 11.0.11+9-LTS, mixed mode, sharing)
GraalVM 21.1.0 Java 11 CE
(Running under quay.io/quarkus/ubi-quarkus-native-image:21.1-java11 since I don't have GraalVM on my workstation)2.1.4.FINAL
Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
The text was updated successfully, but these errors were encountered: