Created
March 31, 2022 21:22
-
-
Save mccutchen/ace7cc85bb6ec7d846946c77b4e41916 to your computer and use it in GitHub Desktop.
gcloud — a wrapper that executes the gcloud CLI in a docker container, to avoid requiring a local installation.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# A wrapper that executes the gcloud CLI in a docker container, to avoid | |
# requiring a local installation. | |
# | |
# Adapted from this helpful blog post: | |
# https://blog.scottlowe.org/2018/09/13/running-gcloud-cli-in-a-docker-container/ | |
GCLOUD_SDK_TAG="312.0.0" | |
exec docker run \ | |
--rm -it \ | |
--workdir /code \ | |
-v $PWD:/code \ | |
-v $HOME/.config/gcloud:/root/.config/gcloud \ | |
google/cloud-sdk:$GCLOUD_SDK_TAG \ | |
gcloud $* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment