0
votes

I am trying to deploy on Google Cloud Platform for the first time using the following two tutorials:

  1. Gcloud build quickstart
  2. Gcloud deploy quickstart

However, when running the final command gcloud builds submit --config cloudbuild.yaml, where cloudbuild.yaml is the name of the yaml file as per tutorial, throws the following error:

Cloud Run error: Container failed to start. Failed to start and then listen on the port defined by the PORT environment variable. Logs for this revision might contain more information.

1
you can take a look at the cloud run quickstart where the whole process is merged into oneLouis C

1 Answers

0
votes

The image created by the build quickstart is not appropriate for the deploy quickstart. The latter, using Cloud Run needs something talking HTTP on port 8080.

If you using the deploy quickstart as-is, that should work. You can test this container image locally using:

docker run \
--interactive --tty \
--publish=8080:8080 \
gcr.io/gcbdocs/hello

and then try browsing or curling the endpoint http://localhost:8080. You should see Hello world!.

The error message from Cloud Run is somewhat generic and means that something went wrong. As a result it's often unhelpful.

If you're confident you're deploying a container image that talks HTTP on port 8080, I recommend you step through the instructions to try to see where you went wrong.