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

GOOGLE_APPLICATION_CREDENTIALS for Google's Artifact Registry (*-docker.pkg.dev) #3239

Closed
briananderson1222 opened this issue May 17, 2021 · 2 comments · Fixed by #3241
Closed
Milestone

Comments

@briananderson1222
Copy link

briananderson1222 commented May 17, 2021

Environment:

  • Jib version: 3.0.0
  • Build tool: Maven (3.8.3)
  • OS: OSX Big Sur

Description of the issue:
Images with path gcr.io are correctly able to use GOOGLE_APPLICATION_CREDENTIALS to resolve the ability to upload. *-docker.pkg.dev Google Artifact Registry cannot leverage this same technique.

Expected behavior:
I believe Google Artifact Registry should use *-docker.pkg.dev to give the same first class treatment of Application Default Credentials

Might just need to add this path here? --

if (imageReference.getRegistry().endsWith("gcr.io")) {

Steps to reproduce:

  1. ADC set via GOOGLE_APPLICATION_CREDENTIALS
  2. Try gcr.io image path w/ Success
  3. Try -docker.pkg.dev w/ no attempt to resolve via ADC

jib-maven-plugin Configuration:

<configuration>
    <to>
        <!--  <image>gcr.io/my-project/my-image:latest</image>  <!-- SUCCESS -->
        <image>us-central1-docker.pkg.dev/my-project/container-registry/my-image:latest</image>
        <tags>${git.commit.id}</tags>
    </to>
</configuration>

Log output: 403 Forbidden

Additional Information: https://cloud.google.com/artifact-registry/docs/docker/pushing-and-pulling

  • GAR by default uses the same credentials resolver as gcr.i
@chanseokoh
Copy link
Member

Thanks for the feedback! This will be supported in the next release.

@chanseokoh
Copy link
Member

chanseokoh commented Jun 9, 2021

@briananderson1222 Jib 3.1.1 is released with this fix. Let us know if you still experience an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants