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 Container Registry authentication via oauth2 token #280

Open
camelpunch opened this issue May 20, 2021 · 0 comments · May be fixed by #289
Open

Google Container Registry authentication via oauth2 token #280

camelpunch opened this issue May 20, 2021 · 0 comments · May be fixed by #289

Comments

@camelpunch
Copy link

camelpunch commented May 20, 2021

It'd be nice to be able to rely on a Concourse worker's IAM roles in GCP to authenticate with Google Container Registry.

Step 5 of https://cloud.google.com/container-registry/docs/advanced-authentication#token shows how to log in to regular docker using a token obtained from Google's metadata servers (i.e. "workload identity" from a VM or K8s container).

The Google container libraries that this project uses should already support this, but I think we'd need to avoid the checks for username/password or require a special-case username to allow the library to retrieve credentials.

A manual way, from a GCP instance / GKE container (without e.g. jq) would be:

curl -H "Metadata-Flavor: Google" http://169.254.169.254/computeMetadata/v1/instance/service-accounts/default/token \
| sed 's/.*access_token":"\(.*\)","expires.*/\1/' \
| docker login -u oauth2accesstoken --password-stdin https://eu.gcr.io/some-repo

Thoughts?

@reedk-au reedk-au linked a pull request Jul 9, 2021 that will close this 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.

1 participant