-
Notifications
You must be signed in to change notification settings - Fork 580
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Doc Improvement: using Google Container Registry (GCR) #78
Comments
@EronWright I think I ran into this issue before. I was trying to push to GCR and use my SA as the password, like the current README.md says to:
This didn't work. You can see all the details about the problem I had in #80. I ended up only being able to get it to work by using gcloud and docker directly without going through an action. Would it be considered insecure though to run |
Will come with #71 :) |
@EronWright This will be available through build-push-action v2 (#92) and you can already try the login-action to authenticate against GCR. |
Version 2 has been merged to the main branch and is therefore available via As a reminder, this new version changes drastically and works with 3 new actions (login, setup-buildx and setup-qemu) that we have created. Many usage examples have been added to handle most use cases. And it should fix this current issue. Don't hesitate if you have any questions. |
Thanks @crazy-max, looks great. The examples don't cover Google Container Registry specifically, but I would guess that |
See https://github.com/docker/#-action#google-container-registry-gcr |
It is somewhat counter-intuitive that one cannot use a credentials helper with
build-push-action
. The underlying reason is thatbuild-push-action
is a docker-based action (as opposed to a JS action) and doesn't inherit the runner's gcloud or docker configuration. In other words,gcloud auth configure-docker
doesn't work withbuild-push-action
.Here's a technique to use
build-push-action
in combination withsetup-gcloud
. The benefit of this approach is that it interoperates well with other GCP-related actions. It relies on the use of access tokens (as described here). Note that the access token is short-lived.Be sure to add a secret to your repository named
GCP_SA_KEY
containing the base64-encoded service account key (as described here).Here,
[PROJECT-ID]
is the Google Cloud project ID of the project that hosts Container Registry, and[IMAGE]
is the image name.The text was updated successfully, but these errors were encountered: