easyMultiple Choice
Google ACE Practice Question: A team has a Docker container image locally and…
A team has a Docker container image locally and wants to push it to Google Artifact Registry. They've already authenticated Docker with GCP. The registry host is 'us-central1-docker.pkg.dev'. Which commands correctly tag and push the image?
⚠ Common exam trap
Google Cloud often tests the distinction between Google Container Registry (gcr.io) and Artifact Registry (LOCATION-docker.pkg.dev), and candidates mistakenly use gcr.io commands or syntax for Artifact Registry, or assume gcloud commands can replace standard Docker CLI commands for pushing images.
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
✓
docker tag myimage us-central1-docker.pkg.dev/myproject/myrepo/myimage:v1 && docker push us-central1-docker.pkg.dev/myproject/myrepo/myimage:v1
It uses the standard Docker CLI workflow: first tagging the local image with the full Artifact Registry path (including the registry host, project, repository, and image name with tag), then pushing it. Since the team has already authenticated Docker with GCP, the `docker push` command will authenticate via the Docker credential helper and upload the image to the specified Artifact Registry repository.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
docker tag myimage us-central1-docker.pkg.dev/myproject/myrepo/myimage:v1 && docker push us-central1-docker.pkg.dev/myproject/myrepo/myimage:v1
Why this is correct
This is the correct approach because it fully specifies the Artifact Registry destination in the Docker image tag. The format `[REGION]-docker.pkg.dev/[PROJECT]/[REPO]/[IMAGE]:[TAG]` tells Docker exactly which regional Artifact Registry repository to use. First `docker tag` creates a new tag pointing to the local image, then `docker push` uploads the image to that fully-qualified repository path. This is the required pattern for pushing images to Artifact Registry.
- ✗
gcloud artifacts docker push myimage --location=us-central1 --repository=myrepo
Why it's wrong here
`gcloud artifacts docker push` is not a valid command. The `gcloud artifacts` command family manages repositories and permissions, but pushing an actual container image must be done with the standard `docker push` command. Even if you supply `--location` and `--repository`, the gcloud CLI cannot act as a Docker client; the image must first be tagged with the full regional repository path so the Docker daemon can resolve the registry endpoint.
- ✗
docker push gcr.io/myproject/myimage:v1
Why it's wrong here
Pushing to `gcr.io/myproject/myimage:v1` targets the legacy Container Registry, not Artifact Registry. Container Registry uses a single global host (`gcr.io`) with only project and image name, whereas Artifact Registry requires the region and repository in the host (`[REGION]-docker.pkg.dev/[PROJECT]/[REPO]/[IMAGE]:[TAG]`). Also, `gcr.io` does not support the same repository-based isolation and regional control as `pkg.dev`. Even if your project has both services enabled, this command does not place the image in the intended Artifact Registry repository.
- ✗
gcloud container images push myimage:v1 --region=us-central1
Why it's wrong here
The `gcloud container images push` command does not exist in the Cloud SDK. The `gcloud container images` subcommands are for managing Container Registry images (e.g., list, describe, delete, add-tag), but pushing an image is always done with the standard `docker push` client after tagging. Additionally, `--region` is not a valid flag for any `gcloud container images` operation, and the gcloud CLI cannot handle the Docker image upload itself.
Go deeper
Related to this question
Learn chapter
GKE Autopilot vs Standard Mode
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.
Key term
Artifact Registry
Artifact Registry is a managed service for storing, managing, and securing container images and other software packages in a centralized repository.
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 by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.