Skip to content

Instantly share code, notes, and snippets.

@revant
Last active December 14, 2022 17:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save revant/2e73804c52a7389951aa26736b864f26 to your computer and use it in GitHub Desktop.
Save revant/2e73804c52a7389951aa26736b864f26 to your computer and use it in GitHub Desktop.
gcloud in container

Start Container:

docker run --rm -it \
  -v $PWD/data/gcloud:/root \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -e "TERM=xterm-256color" google/cloud-sdk:alpine sh

Prepare Container:

# Install needed apks
apk add -U zsh docker-cli docker-cli-compose

Note: Use gcloud with full path e.g. /google-cloud-sdk/bin/gcloud or add /google-cloud-sdk/bin to PATH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment