Authorizing to Google Container Registry using auth

auth
#1

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?

0 Likes

#2

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

#3

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

2 Likes