Google Cloud authentication and Docker¶
Using a separate container for storing the Google cloud credentials we can easily target certain commands to run with that authentication in place.
Create Container¶
First, create the gcloud-config
container:
This will store your credentials in the gcloud-config container volume.
Setup authentication and environment¶
Download a service account credentials file from Google and setup the .env
in your project root:
GOOGLE_APPLICATION_CREDENTIALS=my-google-service-creds.json
GOOGLE_APPLICATION_SERVICE_ACCOUNT=my-google@**.iam.gserviceaccount.com
GOOGLE_PROJECT=my-project
GOOGLE_DATACENTER=us-central1-a
Attach container to OGC¶
Next, to use that with OGC, run: