CKAD Application Design and Build Practice Question
A developer wants to tag a local image 'myapp:latest' with the tag 'v1.0.0' for pushing to a registry. Which command does this?
⚠ Common exam trap
The trap is that candidates might think they need to use kubectl for image operations, but tagging a local image is a Docker operation. Also, they might confuse `kubectl set image` with tagging, but that command updates a deployment's container image, not a local image tag.
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 myapp:latest myapp:v1.0.0
The `docker tag` command is used to tag an existing local image with a new tag. After tagging, the image can be pushed to a registry using `docker push`. There is no `kubectl tag` command; Kubectl does not manage local image tagging. `kubectl set image` is used to update the image of a deployment, not to tag a local image.
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 push myapp:v1.0.0
Why it's wrong here
docker push uploads an image from the local daemon to a remote registry (e.g., Docker Hub, ECR, GCR). Before pushing, the image must already have the exact repository and tag that you want it to have in the registry, because the push copies the image under its current tag. Running 'docker push myapp:v1.0.0' without first tagging the image as myapp:v1.0.0 would fail with 'An image does not exist locally with the tag'. Even if the image existed, this command would not create a new local tag; it would merely transfer an already-tagged image to a remote location.
- ✓
docker tag myapp:latest myapp:v1.0.0
Why this is correct
docker tag creates an additional tag for an existing local image without altering the underlying image layers or content. Its syntax is 'docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]', so 'docker tag myapp:latest myapp:v1.0.0' assigns v1.0.0 as a new alias to the same image ID as the latest tag. This is the standard way to version a local image before pushing or referencing it outside the local daemon. The original latest tag remains intact, and both tags now point to the same image digest.
- ✗
kubectl tag myapp:latest myapp:v1.0.0
Why it's wrong here
kubectl tag is not a valid kubectl command; the Kubernetes CLI provides 'kubectl label', 'kubectl annotate', and 'kubectl set image', but not a 'tag' verb. More importantly, kubectl is architected to interact with Kubernetes API resources (pods, services, deployments) and cannot manage the local Docker image store. Even if a plugin or wrapper existed, there is no concept of tagging a local image through the Kubernetes API. The correct tool for tagging local images is the Docker CLI, which communicates with the Docker daemon.
- ✗
kubectl set image myapp:v1.0.0
Why it's wrong here
kubectl set image is a Kubernetes imperative command that changes the container image reference for resources like Deployments, StatefulSets, or ReplicaSets. It has no effect on local Docker images, because it operates against the cluster API and expects a workload resource as its target. Here you are not specifying a resource but an image name, so kubectl would error out rather than performing a tag. Local image tagging is purely a client-side operation handled by the Docker daemon, not by the Kubernetes control plane.
Go deeper
Related to this question
About these practice questions
One of 826 original CKAD practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This CKAD practice question is part of Courseiva's free CNCF 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 CKAD exam.