Quick Blogs
Quick command line actions
# add project id to the environment variableexport PROJECT_ID=$(gcloud config list --format 'value(core.project)')
Build docker images and push to container registry
# authentication for docker# from https://cloud.google.com/container-registry/docs/advanced-authenticationgcloud auth configure-docker# build a docker image locally and push to GCP container registrydocker build -t gcr.io/ivikramtiwari/website:latest .gcloud docker -- push gcr.io/omni-daeos-runner/website:latest# or just use cloud builds which will automatically store the image in registrygcloud builds submit --timeout 2h --tag gcr.io/ivikramtiwari/website:latest .# pull image for usagegcloud docker -- pull gcr.io/ivikramtiwari/website:latest# -- (double dashes) are used to pass parameters to docker.# If advanced authentication is set up properly, you can skip using# gcloud docker# and just use# docker
More commands for quick usage
# copy files from a VM to localgcloud compute scp --recurse my-vm://home/vikramtheone1/my-files/ ./ --zone=us-central1-b