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

Quarkus build with quarkus.container-image.builder=jib does not consider podman's auth.json #35609

Closed
codequester opened this issue Aug 28, 2023 · 3 comments · Fixed by #35613
Assignees
Labels
area/container-image kind/bug Something isn't working
Milestone

Comments

@codequester
Copy link

codequester commented Aug 28, 2023

Describe the bug

I get the exception below when i try to build my quarkus app after login in using podman login but without the properties quarkus.container-image.username and quarkus.container-image.password

[ERROR] Caused by: com.google.cloud.tools.jib.api.RegistryUnauthorizedException: Unauthorized for ...

Not sure if i am looking at the right place but when i look at the code here it does not consider the podman authfile in ${XDG_RUNTIME_DIR}/containers/auth.json.

as an alternative i was able to create a sym link - $HOME/.docker/config.json to the podman's auth file to get it working.

It will be nice to add the podman's authfile if the docker config is not found.

Expected behavior

The build should work and should produce a container image

Actual behavior

The build throws an exception

[ERROR] Caused by: com.google.cloud.tools.jib.api.RegistryUnauthorizedException: Unauthorized for ...

How to Reproduce?

  1. Remove $home/.docker/config.json
  2. Before running the build, authenticate to the container registry using podman login
  3. Run the build without the properties quarkus.container-image.username and quarkus.container-image.password

Output of java -version

OpenJDK Runtime Environment GraalVM CE 17.0.8+7.1 (build 17.0.8+7-jvmci-23.0-b15) 
OpenJDK 64-Bit Server VM GraalVM CE 17.0.8+7.1 (build 17.0.8+7-jvmci-23.0-b15, mixed mode, sharing)

Quarkus version or git rev

4.3.0

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.9.3 (21122926829f1ead511c958d89bd2f672198ae9f)

@codequester codequester added the kind/bug Something isn't working label Aug 28, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Aug 28, 2023

/cc @geoand (jib)

geoand added a commit to geoand/quarkus that referenced this issue Aug 29, 2023
@geoand
Copy link
Contributor

geoand commented Aug 29, 2023

Would you be able to test #35613?

@geoand geoand self-assigned this Aug 29, 2023
@codequester
Copy link
Author

codequester commented Aug 30, 2023

@geoand I was able to test and it worked. Here is what i did

  1. Checked out your PR
gh pr checkout 35613
  1. Followed the docs here
export MAVEN_OPTS="-Xmx4g"
./mvnw -Dquickly
./mvnw install -f extensions/container-image/container-image-jib
  1. Replaced my local .m2 repo jar with the one that was generated above and renamed it. This is coz I don't know how to use a specific version of an extension
cp ~/.m2/repository/io/quarkus/quarkus-container-image-jib/999-SNAPSHOT/quarkus-container-image-jib-999-SNAPSHOT.jar ~/.m2/repository/io/quarkus/quarkus-container-image-jib/3.3.0/quarkus-container-image-jib-3.3.0.jar
  1. Ran the tests successfully
./mvnw -f integration-tests/container-image/ clean install

  1. Delete the symbolic link to podman's auth
rm -rf ~/.docker/config.json
  1. do the maven build and push the image to the repo
./mvnw quarkus:build -DskipTests -D"quarkus.container-image.push=true" -D"quarkus.container-image.builder=jib"

The build worked and images was successfully build and pushed to the repo.

@quarkus-bot quarkus-bot bot added this to the 3.4 - main milestone Aug 30, 2023
@gsmet gsmet modified the milestones: 3.4 - main, 3.3.2 Sep 4, 2023
gsmet pushed a commit to gsmet/quarkus that referenced this issue Sep 4, 2023
@aloubyansky aloubyansky modified the milestones: 3.3.2, 3.2.8.Final Oct 31, 2023
aloubyansky pushed a commit to aloubyansky/quarkus that referenced this issue Oct 31, 2023
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.

4 participants