Sign inSign up

dwdraju/alpine-gcloud

By dwdraju

Updated about 5 years ago

Minimal Google cloud sdk with alpine base.

Image
0

10K+

dwdraju/alpine-gcloud repository overview

LightWeight Docker image for the Google Cloud SDK

  • Image based on alpine linux
  • Minimal Docker image for gcloud

Usage Guide

Pull this image Docker Hub:

docker pull dwdraju/alpine-gcloud:latest
Browser Authentication

To authenticate the gcloud sdk docker image using browser authentication, run

docker run -ti --name gsdocker dwdraju/alpine-gcloud gcloud auth login
Service Account Authentication
  • Create service account from IAM & admin
  • Download the key file in json format and paste it on service-account-key.json
  • Give permission to the service account as per requirement
  • Get the *GCLOUD_PROJECT_ID- and set it as environment variable: export GCLOUD_PROJECT_ID=myprojectID
  • Run the command:
docker run -ti -v $(pwd)/service-account-key.json:/service-account-key.json --name gcdocker dwdraju/alpine-gcloud gcloud auth activate-service-account --key-file=/service-account-key.json  --project "$GCLOUD_PROJECT_ID" --quiet

Additional flags like ACCOUNT_NAME, --prompt-for-password can be used during authentication. Full list is on Cloud SDK doc

Usage

The docker image can be used to access resources in google cloud as bounded by IAM permission using the volume. To list the container clusters:

docker run --rm -ti --volumes-from gcdocker dwdraju/alpine-gcloud gcloud container clusters list

Tag summary

Content type

Image

Digest

Size

104.6 MB

Last updated

about 5 years ago

docker pull dwdraju/alpine-gcloud