Build a container based on main.py and requirements.txt

PHOTO EMBED

Mon Mar 21 2022 01:29:18 GMT+0000 (Coordinated Universal Time)

Saved by @jmbenedetto #bash

gcloud builds submit --pack image=us-central1-docker.pkg.dev/analytics-dev-308300/functions/talentcard-reports-to-landing-zone,env=GOOGLE_FUNCTION_TARGET=start
content_copyCOPY

gcloud builds submit takes the source files in the current directory, uploads them to GCP and then performs container construction. GOOGLE_FUNCTION_TARGET tells cloud run to inject the Cloud Functions framework into the resulting container such that it will call the code supplied function when a request arrives. start: name of the function to be triggered by the http request. It must be inside the code file supplied. image: insert where the container should be stored after creation.

https://medium.com/google-cloud/cloud-functions-to-cloud-run-e297aac28eb8