Bird
0
0

You deployed a container to Cloud Run but it fails to start. The error says the container does not listen on the expected port. What is the likely cause?

medium📝 Debug Q14 of 15
GCP - Cloud Run
You deployed a container to Cloud Run but it fails to start. The error says the container does not listen on the expected port. What is the likely cause?
ACloud Run requires containers to listen on the port defined by the PORT environment variable.
BCloud Run only supports containers that listen on port 80 hardcoded.
CCloud Run does not allow containers to listen on any port.
DCloud Run automatically assigns a random port and no configuration is needed.
Step-by-Step Solution
Solution:
  1. Step 1: Identify Cloud Run port requirement

    Cloud Run expects containers to listen on the port specified by the PORT environment variable it sets.
  2. Step 2: Understand common error cause

    If the container listens on a different port, Cloud Run cannot route traffic correctly, causing startup failure.
  3. Final Answer:

    Cloud Run requires containers to listen on the port defined by the PORT environment variable. -> Option A
  4. Quick Check:

    Listen on PORT env variable = B [OK]
Quick Trick: Containers must listen on PORT env variable in Cloud Run [OK]
Common Mistakes:
  • Assuming port 80 is always used
  • Thinking Cloud Run forbids listening on ports
  • Believing no port configuration is needed

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GCP Quizzes