skip to Main Content

I’m following the Google Cloud Run quickstart for Python, but it ain’t working. I am running Python 3.7, have gcloud installed, and have all the necessary permissions on my project.

Here’s the tutorial I followed: https://cloud.google.com/run/docs/quickstarts/build-and-deploy/deploy-python-service

Here’s evidence I copied their four files into the right place locally:

******@penguin:~/helloworld$ ls -a
.  ..  Dockerfile  .dockerignore  main.py  requirements.txt

And yet here’s what I see when I run the final command, gcloud run deploy:

******@penguin:~/helloworld$ gcloud run deploy
ERROR: (gcloud.run.deploy) argument --image: Must be specified.

According to the error, I need to specify an image (presumably existing), yet the tutorial is explicit that running this command from the source directory will automatically build an image. Here’s their line: "Deploy from source automatically builds a container image from source code and deploys it."

Thanks for any tips.

2

Answers


  1. Ok, update your gcloud SDK. the Current version is 379, you are 62 versions behind, more than 1 year, and 1year ago, the gcloud run deploy to upload sources, build a container and deploy it on Cloud Run didn’t exist

    Login or Signup to reply.
  2. Supposing you are in the folder where the files are, you can create a docker image:

    gcloud builds submit --tag gcr.io/your_project_id/image_name .
    

    Then

    gcloud run deploy service-name --image gcr.io/your_project_id/image_name
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search