Notes
  • Welcome
  • All
  • Byte Bites
    • What happens in the mind's eye
    • Be a thermostat, not a thermometer
    • Software Development Waste
    • Better Conversations
    • How to decide
    • Effective delegation
    • Important Statistical Ideas of Past 50 years
    • 9 Lines with all of Physics
    • Akin's Laws of Spacecraft Design
    • Harry Browne's 17 Golden Rules of Financial Safety
    • Code lifecycle
    • Experts vs Imitators
    • Giving feedback
    • Technical Documentation Authoring
  • Notes
    • Programming - General
      • A short guide to hard problems
      • Another way to put it
      • Practices for debugging
    • TensorFlow
    • Programming Languages
      • Bash
      • JS and Node.js
      • Regex
      • Python
    • Git/GitHub
    • Browsers
    • Blogs
    • Nginx + Docker + Let'sEncrypt on Ubuntu
    • Google Cloud
    • Docker and Kubernetes
    • Databases
    • Website Testing Tools
    • Design Resources
    • Trusted Services
  • Generative AI Universe
    • Taking Flight with AI Agents
  • Community
    • Speaking and writing Tips
  • Social
    • Books
    • Explore
  • Help me!
Powered by GitBook
On this page

Was this helpful?

  1. Notes

Google Cloud

All the goodness of Google Cloud Platform

PreviousNginx + Docker + Let'sEncrypt on UbuntuNextDocker and Kubernetes

Last updated 1 year ago

Was this helpful?

  • Free

  • Quick Blogs

  • Quick command line actions

# add project id to the environment variable
export 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-authentication
gcloud auth configure-docker

# build a docker image locally and push to GCP container registry
docker 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 registry
gcloud builds submit --timeout 2h --tag gcr.io/ivikramtiwari/website:latest .

# pull image for usage
gcloud 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

VMs

# copy files from a VM to local
gcloud compute scp --recurse my-vm://home/vikramtheone1/my-files/ ./ --zone=us-central1-b

BigQuery

# this will de-deup data based on all rows matching each other
CREATE OR REPLACE TABLE `project.dataset.table`
PARTITION BY timestamp
AS SELECT DISTINCT * FROM `project.dataset.table`

Free QwikLabs to build your skills using hands-on labs
All free services from Google Cloud Platform
Self destruct VMs