I am using cloud run. I pull docker images, then push them directly to a google container registry and then link them to Cloud Run Service. However, when I try to deploy Cloud Run Service I don't know why every time this show me this 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.
Please, someone, give me any solution and what is actually saying which file should I change or which kind of change should I made??
It's the default error message when the container don't start, even if you have well defined the port to listen.
Go to the logs and see what exactly happens. You could fix the start with the correct message.
When you provide a container image to Cloud Run, that contain has a contract that it must fulfill in order to operate correctly. Please read that contract, especially the part about listening on a port:
Listening for requests on PORT
The container must listen for requests on 0.0.0.0 on the port defined by the PORT environment variable.
In Cloud Run container instances, the PORT environment variable is always set to 8080, but for portability reasons, your code should not hardcode this value.
Your container must be running a processing that's listening on port 8080, or whatever the PORT environment variable is. If it's not doing that, it can't receive incoming requests.
See also Cloud Run troubleshooting documentation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With