0
0
Dockerdevops~5 mins

Image tags and versioning in Docker - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a Docker image tag?
A Docker image tag is a label that identifies a specific version of a Docker image. It helps you choose which version of the image to use when running containers.
Click to reveal answer
beginner
Why should you use version tags instead of the 'latest' tag?
Using version tags ensures you run a specific, tested image version. The 'latest' tag can change over time, which might cause unexpected behavior or bugs.
Click to reveal answer
beginner
How do you specify a tag when pulling a Docker image?
You add a colon and the tag name after the image name. For example: docker pull ubuntu:22.04 pulls the Ubuntu image tagged '22.04'.
Click to reveal answer
beginner
What happens if you don't specify a tag when pulling a Docker image?
Docker uses the 'latest' tag by default, which means it pulls the image tagged as 'latest'. This might not always be the version you want.
Click to reveal answer
intermediate
How can you tag a local Docker image with a new version?
Use the command docker tag SOURCE_IMAGE[:TAG] TARGET_IMAGE[:TAG]. For example, docker tag myapp:1.0 myapp:1.1 creates a new tag '1.1' for the same image.
Click to reveal answer
What does the Docker tag 'latest' mean?
AIt is a tag you must always specify manually
BIt always points to the oldest image version
CIt is a special tag that deletes images
DIt is the default tag if none is specified
How do you pull a specific version of an image named 'nginx' tagged '1.23'?
Adocker pull nginx:1.23
Bdocker pull nginx-1.23
Cdocker pull nginx/latest
Ddocker pull nginx
Why is it risky to always use the 'latest' tag in production?
ABecause 'latest' images are always unstable
BBecause 'latest' might change and cause unexpected bugs
CBecause 'latest' deletes old images automatically
DBecause 'latest' is not supported by Docker
How do you add a new tag '2.0' to an existing local image 'myapp:1.0'?
Adocker build myapp:2.0
Bdocker pull myapp:2.0
Cdocker tag myapp:1.0 myapp:2.0
Ddocker push myapp:2.0
What is the correct format to specify an image with a tag?
Aimage_name:tag
Bimage_name/tag
Cimage_name#tag
Dimage_name@tag
Explain why using specific version tags for Docker images is important in software deployment.
Think about what happens if your app suddenly uses a different image version without warning.
You got /4 concepts.
    Describe how to tag a Docker image locally and why you might want to do this.
    Tagging is like giving a nickname to a photo so you can find it easily later.
    You got /4 concepts.