PROFESSIONAL-CLOUD-DEVELOPER · Question #236
You recently developed a new application. You want to deploy the application on Cloud Run without a Dockerfile. Your organization requires that all container images are pushed to a centrally managed c
The correct answer is C. Use the pack build command with pack CLI. D. Include the --source flag with the gcloud run deploy CLI command.. Both C and D work together to build a container image without a Dockerfile using buildpacks. The 'pack build' command (option C) uses Cloud Native Buildpacks to automatically detect the runtime and build the image without requiring a Dockerfile. The '--source' flag with 'gcloud r
Question
You recently developed a new application. You want to deploy the application on Cloud Run without a Dockerfile. Your organization requires that all container images are pushed to a centrally managed container repository. How should you build your container using Google Cloud services? (Choose two.)
Options
- APush your source code to Artifact Registry.
- BSubmit a Cloud Build job to push the image.
- CUse the pack build command with pack CLI.
- DInclude the --source flag with the gcloud run deploy CLI command.
- EInclude the --platform=kubernetes flag with the gcloud run deploy CLI command.
How the community answered
(31 responses)- A13% (4)
- B3% (1)
- C77% (24)
- E6% (2)
Explanation
Both C and D work together to build a container image without a Dockerfile using buildpacks. The 'pack build' command (option C) uses Cloud Native Buildpacks to automatically detect the runtime and build the image without requiring a Dockerfile. The '--source' flag with 'gcloud run deploy' (option D) triggers Cloud Build to use buildpacks to build from source code, push the resulting image to Artifact Registry (satisfying the centralized repository requirement), and then deploy to Cloud Run. Option A is invalid because Artifact Registry stores container images, not source code. Option B (submitting a Cloud Build job) could work but typically requires a Dockerfile or explicit buildpack configuration. Option E references a Kubernetes platform flag unrelated to this use case.
Topics
Community Discussion
No community discussion yet for this question.