Skip to content

Instantly share code, notes, and snippets.

@ojhaujjwal
Last active April 12, 2020 15:21
Show Gist options
  • Save ojhaujjwal/9e25cf80eb639ec1a7db244c4ff5655e to your computer and use it in GitHub Desktop.
Save ojhaujjwal/9e25cf80eb639ec1a7db244c4ff5655e to your computer and use it in GitHub Desktop.
#!/usr/bin/env sh
set -eu
export GCP_PROJECT=my-gcp-project
export APP_NAME=cloudrun-node-app-demo
# Logging in to GCR using service account credentials placed on ./gcp-credentials.json
cat ./gcp-credentials.json | docker login -u _json_key --password-stdin https://gcr.io
export IMAGE_TAG=$(git rev-parse HEAD)
export IMAGE_NAME = gcr.io/${GCP_PROJECT}/${APP_NAME}:${IMAGE_TAG}
docker build -t ${IMAGE_NAME} -f Dockerfile .
docker push ${IMAGE_NAME}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment