Cloud SDK Quick Reference

Setting up Cloud SDK

Set default project in command line

gcloud config set project PROJECT_ID

Open cloud shell with course materials

Open in Cloud Shell

Open Cloud Shell from your machine

gcloud cloud-shell ssh

Use Docker instead of installing Cloud SDK

Login, that would create the volume with credentials:

docker run -ti --name gcloud-config google/cloud-sdk gcloud auth login

Create an script in your $PATH named gcloud with:

#!/bin/sh
docker run --platform linux/amd64 --rm -ti --volumes-from gcloud-config -w /tmp/current -v $(pwd):/tmp/current google/cloud-sdk gcloud $@

And another one named gsutil with:

#!/bin/sh
docker run --platform linux/amd64 --rm --volumes-from gcloud-config -w /tmp/current -v $(pwd):/tmp/current google/cloud-sdk gsutil "$@"