Link Search Menu Expand Document

gcloud

Installing the Cloud SDK Docker image

docker run --rm gcr.io/google.com/cloudsdktool/cloud-sdk:latest gcloud version
Google Cloud SDK 344.0.0
alpha 2021.06.04
app-engine-go 1.9.71
app-engine-java 1.9.89
app-engine-python 1.9.93
app-engine-python-extras 1.9.93
beta 2021.06.04
bigtable
bq 2.0.69
cbt 0.9.0
cloud-datastore-emulator 2.1.0
cloud-firestore-emulator 1.11.15
cloud-spanner-emulator 1.2.0
core 2021.06.04
datalab 20190610
gsutil 4.62
kpt 0.39.2
local-extract 1.0.0
pubsub-emulator 0.4.1
  • Authenticate with the gcloud command-line tool by running:
docker run -ti \
    --name gcloud-config gcr.io/google.com/cloudsdktool/cloud-sdk \
    gcloud auth login

Once you've authenticated successfully, credentials are preserved in the volume of the gcloud-config container.

  • List compute instances using these credentials to verify by running the container with --volumes-from:
PROJECT_ID=adithya321
docker run --rm --volumes-from \
    gcloud-config gcr.io/google.com/cloudsdktool/cloud-sdk \
    gcloud compute instances list --project $PROJECT_ID
Listed 0 items.

Children

  1. Compute
  2. Networking