diff --git a/ops/gcp/useful-commands.md b/ops/gcp/useful-commands.md new file mode 100644 index 0000000..83bf56c --- /dev/null +++ b/ops/gcp/useful-commands.md @@ -0,0 +1,45 @@ +# Useful Commands for Google Cloud Platform + +## Download gcloud cli +Download gcloud cli using following link, based on your OS: https://docs.cloud.google.com/sdk/docs/install-sdk + +## Login to GCP +```bash +gcloud init +gcloud auth login +``` + +## Authorize Local Docker to push to GCP's Artifact Registry +```bash +gcloud auth configure-docker \ + northamerica-northeast1-docker.pkg.dev +``` + +## Docker Commands + +### Tagging Images +To tag a specific local image: +```bash +docker tag -docker.pkg.dev/// +``` + +- `` can be same as `` +- `-docker.pkg.dev///` + +Example Tag command: +```bash +docker tag surigo/anizenith:latest northamerica-northeast1-docker.pkg.dev/anizenith/anizenith-repo/anizenith:latest +``` + +### Pushing Images +To push a tagged image: +```bash +docker push +``` + +- `` is the same as `-docker.pkg.dev///` + +Example Push command +```bash +docker push northamerica-northeast1-docker.pkg.dev/anizenith/anizenith-repo/anizenith:latest +``` \ No newline at end of file