What is a Docker image tag?
A Docker image tag is a label assigned to an image to distinguish its versions. Usually the tag is used as a human-readable version name, for example: latest, 1.0, dev, prod.
What a tag looks like
bash
nginx:1.25
python:3.10
myapp:latestWhere:
nginx,python,myapp- the image name1.25,3.10,latest- the tag
Why a tag is needed
- to keep multiple versions of the same image;
- so that deployment, testing, and development work predictably;
- so you can roll back to a specific version.
A detail worth noting
If no tag is specified, Docker defaults to :latest.
Summary: a tag is a version or label of an image that helps distinguish variants of the same Docker image.
Short Answer
Interview readyPremium
A concise answer to help you respond confidently on this topic during an interview.