D1: Building & Refactoring Containers for Cloud Run & GKE
Google Cloud Professional Cloud Developer exam practice questions · 10 flashcards
Question
Container best practices?
1 / 10
Tip: Space flips the card, ← / → navigate.
Show all 10 Building & Refactoring Containers for Cloud Run & GKE practice questions and answers
- Container best practices?Small base images, multi-stage builds, one process per container, non-root user.
- What port must a Cloud Run container listen on?The port in the PORT environment variable (default 8080).
- Why should Cloud Run services be stateless?Instances are created and destroyed automatically; state must live in external stores.
- What are buildpacks?Build container images from source without a Dockerfile.
- What are multi-stage builds?Build in one stage, copy only artifacts to a slim runtime image.
- How should apps handle config?Environment variables and Secret Manager, not baked into images.
- Refactoring a monolith for containers?Externalize state, split into services, use managed backing services.
- Why handle SIGTERM?Gracefully finish requests before the container stops.
- Where should logs go from containers?stdout/stderr (structured JSON) for Cloud Logging.
- Why pin image versions/digests?Reproducible, secure deployments.