QuestionQ121

Deploying applications

You developed a Python application that you want to containerize and deploy to Cloud Run. You created a Cloud Build pipeline with these steps:

Question Image

After triggering the pipeline, you see in the Cloud Build logs that its final step fails and the container cannot be deployed to Cloud Run. What causes this issue, and how should you fix it?

  • A The final step uses a Cloud Run instance name that does not match the container name. Update the deployment step so that the Cloud Run instance name matches the container name, and rerun the pipeline.
  • B The Docker container image has not been pushed to Artifact Registry. Add a step to the pipeline to push the application container image to Artifact Registry, and rerun the pipeline.
  • C Cloud Run does not allow unauthenticated invocations. Remove the --allow-unauthenticated parameter to enforce authentication on the application, and rerun the pipeline.
  • D Unit tests in the pipeline are failing. Update the application code so that all unit tests pass, and rerun the pipeline.
Explanation

A Docker build creates the tagged image only in the Cloud Build worker unless the configuration also pushes it or declares it in the images field. Cloud Run must be able to retrieve the referenced image from Artifact Registry, so the pipeline must push the application image to Artifact Registry before running gcloud run deploy.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!