Skip to content

Instantly share code, notes, and snippets.

@thikade
Last active September 28, 2019 18:25
Show Gist options
  • Save thikade/91268e30a7689666792574dd57d9382c to your computer and use it in GitHub Desktop.
Save thikade/91268e30a7689666792574dd57d9382c to your computer and use it in GitHub Desktop.
gcloud Cheatsheet

GCLOUD CHEAT SHEET

Managing Builds

Docs

Managing Builds

Note

You can also run a build locally using the separate component: gcloud components install cloud-build-local.

list builds (10 last builds)

gcloud builds list --limit=10

submit new build

gcloud builds submit DIRECTORY [--config=path/to/cloudconfig.yml] [--machine-type=MACHINE_TYPE]

  • MACHINE_TYPE can be:
    • UNSPECIFIED (120 free build minutes per day)
    • N1_HIGHCPU_8

Stream build logs of an existing build

gcloud builds log BUILD [--stream]

BUILD
  • ID of build

Cancel a running build

gcloud builds cancel BUILD [BUILD …]

BUILD
  • IDs of build to cancel

Managing Images

Docs

Managing Images

list images

gcloud container images list --repository=gcr.io/PROJECT-NAME

list image tags

gcloud container images list-tags gcr.io/PROJECT-NAME/IMAGE

tagging images

gcloud container images add-tag  gcr.io/PROJECT-NAME/IMAGE:TAG \
   gcr.io/PROJECT-NAME/IMAGE:NEW-TAG 

untagging images

gcloud container images untag gcr.io/PROJECT-NAME/IMAGE:TAG

deleting images

gcloud container images delete gcr.io/PROJECT-NAME/IMAGE:TAG --force-delete-tags

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