Skip to content

Instantly share code, notes, and snippets.

@eloylp
Created April 12, 2019 18:33
Show Gist options
  • Save eloylp/52e89081a4905c24d2620fae37eabf30 to your computer and use it in GitHub Desktop.
Save eloylp/52e89081a4905c24d2620fae37eabf30 to your computer and use it in GitHub Desktop.
Gcloud cli with docker
docker pull google/cloud-sdk:latest
docker run -ti google/cloud-sdk:latest gcloud version
docker run -ti --name gcloud-config google/cloud-sdk gcloud auth login
docker run --rm -ti --volumes-from gcloud-config google/cloud-sdk gcloud config set project <your-project-id>
docker run --rm -ti -v $(pwd):/src -v /var/run/docker.sock:/var/run/docker.sock:ro --volumes-from gcloud-config google/cloud-sdk bash
## kubernetes
gcloud container clusters get-credentials <your_cluster> --zone <your_zone> --project <your-project-id>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment