Authorizing to Google Container Registry using auth

Our containers are private in Google Container Registry. Following the guide at https://circleci.com/docs/2.0/private-images/, I added:

auth:
           username: _json_key
           password: $GCLOUD_SERVICE_KEY

My question is, how do I pass the Google service key into the envar GCLOUD_SERVICE_KEY? Currently the service key only exists in ~/.gsutil/credstore. What is the recommended way to inject the service key into GCLOUD_SERVICE_KEY?

The recommended approach is to use environment variables as shown here: https://circleci.com/docs/2.0/env-vars/#overview

Does this approach work for you?

1 Like

@levlaz yes, that is what I ended up doing. Thanks.

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.