What is the general format of a Docker image name?
A Docker image name usually follows this format: <registry>/<image>:<tag>. The registry is optional and defaults to Docker Hub if omitted.
Click to reveal answer
beginner
What does the <tag> part in a Docker image name represent?
The <tag> specifies the version or variant of the image. If no tag is given, Docker uses the default tag 'latest'.
Click to reveal answer
intermediate
Why include a registry in the Docker image name?
Including a registry tells Docker where to find the image. It can be Docker Hub or a private registry. This helps Docker pull the image from the correct source.
Click to reveal answer
beginner
Example: What does 'myregistry.com/myapp/backend:1.2' mean?
It means the image is stored in 'myregistry.com' under the repository 'myapp/backend' with the version tag '1.2'.
Click to reveal answer
beginner
What happens if you omit the tag in a Docker image name?
Docker assumes the tag 'latest' by default, so 'ubuntu' is the same as 'ubuntu:latest'.
Click to reveal answer
What is the default tag used if none is specified in a Docker image name?
A1.0
Bstable
Cdefault
Dlatest
✗ Incorrect
If no tag is specified, Docker uses 'latest' as the default tag.
Which part of the Docker image name specifies where to find the image?
Atag
Bregistry
Cimage
Dversion
✗ Incorrect
The registry part tells Docker which server or service to pull the image from.
In the image name 'nginx:alpine', what does 'alpine' represent?
ATag
BImage name
CRegistry
DRepository
✗ Incorrect
'alpine' is the tag specifying a lightweight version of the nginx image.
What happens if you use 'docker pull ubuntu' without a tag?
APulls ubuntu:default
BPulls ubuntu:stable
CPulls ubuntu:latest
DReturns an error
✗ Incorrect
Docker assumes the 'latest' tag if none is provided.
Which of these is a valid Docker image name?
Amyregistry.com/myapp:1.0
Bmyapp:1.0:extra
Cregistry//image:tag
Dimage:tag:version
✗ Incorrect
The format /: is valid. Multiple colons or double slashes are invalid.
Explain the parts of a Docker image name and why each part is important.
Think about where the image is stored, what it is called, and which version to use.
You got /5 concepts.
Describe what happens when you pull a Docker image without specifying a tag.
Consider what Docker assumes and why specifying a tag can be safer.
You got /3 concepts.
Practice
(1/5)
1. Which part of the Docker image name docker.io/library/nginx:latest specifies the version of the image?
easy
A. latest
B. docker.io
C. nginx
D. library
Solution
Step 1: Identify the tag in the image name
The tag is the part after the colon (:), which specifies the version or variant of the image.
Step 2: Locate the tag in the example
In docker.io/library/nginx:latest, the tag is latest.
Final Answer:
latest -> Option A
Quick Check:
Tag = latest [OK]
Hint: Tag is always after colon ':' in image name [OK]
Common Mistakes:
Confusing registry with tag
Thinking image name is the tag
Ignoring the colon separator
2. Which of the following is the correct syntax for a Docker image name with a registry, image, and tag?
easy
A. tag/image:registry
B. registry/image:tag
C. image:tag/registry
D. image/registry:tag
Solution
Step 1: Recall the Docker image naming format
The correct format is registry/image:tag, where registry is optional but comes first, then image name, then tag after colon.
Step 2: Match the options to the format
Only registry/image:tag matches the correct order and separators.
Final Answer:
registry/image:tag -> Option B
Quick Check:
Format = registry/image:tag [OK]
Hint: Registry first, then image, then tag after ':' [OK]
Common Mistakes:
Placing tag before image
Swapping registry and image order
Using wrong separators like '/' for tag
3. What is the full image name including registry and tag for the official Redis image version 7.0 from Docker Hub?
medium
A. docker.io/redis7:0
B. redis:7.0
C. redis/docker.io:7.0
D. docker.io/redis:7.0
Solution
Step 1: Understand Docker Hub default registry
Docker Hub's registry is docker.io. The official images are under this registry.
Step 2: Compose full image name
The full name includes registry, image name, and tag: docker.io/redis:7.0.
Final Answer:
docker.io/redis:7.0 -> Option D
Quick Check:
Full name = docker.io/redis:7.0 [OK]
Hint: Full name = registry/image:tag, Docker Hub registry is docker.io [OK]
Common Mistakes:
Putting registry after image
Missing registry for full name
Incorrect tag format
4. You try to pull the image myregistry.com/myapp but get an error. Which of these is a likely cause?
medium
A. Missing tag defaults to 'latest', but image may not have it
B. Registry name cannot contain dots '.'
C. Image name must always include a tag
D. Registry must be 'docker.io' only
Solution
Step 1: Understand default tag behavior
If no tag is given, Docker uses latest by default. If the image does not have a 'latest' tag, pull fails.
Step 2: Check other options for errors
Registry names can contain dots, tags are optional, and registries can be other than docker.io.
Final Answer:
Missing tag defaults to 'latest', but image may not have it -> Option A
Quick Check:
Default tag 'latest' may be missing [OK]
Hint: No tag means 'latest' assumed, may cause pull failure [OK]
Common Mistakes:
Thinking registry can't have dots
Believing tag is mandatory
Assuming only docker.io registry works
5. You want to tag a local image myapp to push it to a private registry at registry.example.com with version v2. Which command correctly tags the image?
hard
A. docker tag myapp:v2 registry.example.com/myapp
B. docker tag registry.example.com/myapp:v2 myapp
C. docker tag myapp registry.example.com/myapp:v2
D. docker tag myapp registry.example.com:v2/myapp
Solution
Step 1: Understand docker tag syntax
The syntax is docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG].
Step 2: Apply to given names
Source is myapp (local), target is registry.example.com/myapp:v2 to specify registry and tag.
Final Answer:
docker tag myapp registry.example.com/myapp:v2 -> Option C
Quick Check:
Tag command: source then target with registry and tag [OK]
Hint: Tag command: source image then target with registry:tag [OK]
Common Mistakes:
Swapping source and target images
Placing tag in wrong position
Using invalid registry/tag format
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.