
Google Professional Cloud Developer
Get started today
Ultimate access to all questions.
How can you build and deploy a container for your new application on Cloud Run without a Dockerfile, while ensuring the image is pushed to your organization's centralized container repository using Google Cloud services? (Select two correct methods.)
How can you build and deploy a container for your new application on Cloud Run without a Dockerfile, while ensuring the image is pushed to your organization's centralized container repository using Google Cloud services? (Select two correct methods.)
Exam-Like
Explanation:
To deploy an application on Cloud Run without a Dockerfile and ensure the image is stored in a central repository, the recommended approach involves using Google Cloud services like Cloud Build and Buildpacks.
- Option D (
--source
flag withgcloud run deploy
): This triggers Cloud Build automatically, which uses Buildpacks to build the container image, pushes it to Artifact Registry, and deploys to Cloud Run. This satisfies the requirement of using Google Cloud services and storing the image centrally. - Option C (
pack build
command): While thepack
CLI is a local tool, it can be used within a Cloud Build job (a Google Cloud service) to build the image using Buildpacks. This ensures the image is built and pushed to the repository via Google Cloud services.
Options A (incorrect, as Artifact Registry is for images, not source code), B (redundant if using --source
, as Cloud Build is invoked automatically), and E (incorrect, as --platform=kubernetes
is unrelated to Cloud Run) are excluded.