Google ACE Deploying and Implementing a Cloud Solution Practice Question
A company wants to deploy a containerized application on Cloud Run that is built from source code in a local directory. They want Cloud Run to automatically build the container image using Cloud Build. Which command should be used?
⚠ Common exam trap
ACE often tests the difference between deploying from source (--source) and deploying from an image (--image); candidates may choose the manual build option because it also works, but the question specifies automatic build.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
gcloud run deploy my-service --source . --region us-central1
The command gcloud run deploy my-service --source . --region us-central1 uses the --source flag to indicate that Cloud Run should build the container image from the local source code using Cloud Build, then deploy it. This is the correct way to deploy from source.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
gcloud run deploy my-service --source . --region us-central1
Why this is correct
The --source flag tells gcloud to treat the current directory as source code, automatically invoking Cloud Build to containerize it using buildpacks before deploying to Cloud Run in the specified region. This single command combines the build and deploy steps, which is exactly what the requirement of a one-command deployment asks for. The service name 'my-service' is provided, and the region ensures the service is created in us-central1.
- ✗
gcloud app deploy --source .
Why it's wrong here
The gcloud app deploy command targets App Engine, a different serverless product, not Cloud Run. Even with --source, it uploads the code and uses an app.yaml file to determine runtime and scaling settings, producing an App Engine service URL like my-service.appspot.com. Cloud Run services are managed separately via the run API, so this command would not create a Cloud Run service at all.
- ✗
gcloud run deploy my-service --image . --region us-central1
Why it's wrong here
The --image flag for gcloud run deploy requires a reference to an already-built container image, such as gcr.io/my-project/my-image:tag, not a local file path. Passing '.' causes the CLI to attempt to interpret it as an image name, leading to a validation error because no registry host or tag is present. This flag cannot trigger a build; the image must exist before deployment.
- ✗
gcloud builds submit --tag gcr.io/my-project/my-image . && gcloud run deploy my-service --image gcr.io/my-project/my-image
Why it's wrong here
This two-command sequence first uses gcloud builds submit to package the source code into an image and push it to Google Container Registry under the given tag, then deploys that pre-built image to Cloud Run. While it achieves the end result, the requirement specifies a single command, and this approach adds a manual intermediate step of waiting for the build to complete. Additionally, it hard-codes a Container Registry path rather than relying on Cloud Run's built-in source-to-service pipeline.
Go deeper
Related to this question
Learn chapter
Skaffold for Local GKE Development
Key term
Image
An image is a complete snapshot of a system's operating system, applications, and settings, used to deploy or restore computing environments quickly.
Key term
Container
A container is a lightweight, standalone software package that includes everything needed to run an application, such as code, runtime, system tools, and libraries.
About these practice questions
Courseiva writes every ACE question from scratch — 775 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Google Cloud exam blueprint
This ACE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the ACE exam.