Docker
/Intermediate
Image Tagging
Definition
The process of assigning a human-readable alias/version number to a specific image ID to easily identify different variations of an image.
Explain Like I'm New
Giving a name to a version. Instead of remembering the ID `f4a9b2c8`, you attach a tag so you can just call it `myapp:v1.0`.
Real World Example
You build your code and tag it `my-website:v1`. A month later, you change the code and tag the new build `my-website:v2`. Now you can easily run either version just by specifying the tag.
Common Use Cases
- •Version control
- •Rollbacks
- •Environment staging
Interview Questions
basic
- If you run `docker pull ubuntu` without specifying a tag, what tag does Docker automatically assume you want?
intermediate
- Why is it a terrible idea to use the `:latest` tag in a production deployment?