Skip to content

Latest commit

 

History

History
53 lines (33 loc) · 1.2 KB

File metadata and controls

53 lines (33 loc) · 1.2 KB

Use gcloudcli in the devops-toolkit

Prerequisite

A Google Cloud account

gcloudcli document

Some document to help you start with the Google Cloud CLI

Run with Docker command

Note

To use the existing container instead of creating one, use docker exec command instead of docker run

docker exec -it my_devops_toolkit /bin/bash

Common Run Modes

For instructions on common run modes, visit DevOps Toolkit Common Run Mode.

Use case 1: gcloud login and run command

docker run --rm -it -v ~/.dtc:/dtc tungbq/devops-toolkit:latest

# Login with gcloud CLI
gcloud auth login --no-launch-browser
### Copy the printed URL into a browser, sign in, then paste the verification code back into the terminal

# Set the active project
gcloud config set project <YOUR_PROJECT_ID>

# List Compute Engine instances
gcloud compute instances list

Sample Result

root@f097467db632:~# gcloud projects list
PROJECT_ID       NAME          PROJECT_NUMBER
your-project-id  your-project  123456789012

Troubleshooting