Tags Matter
In a previous lesson, we mentioned that an image name can include an optional tag. In this lesson, we will discuss tags in a bit more detail and learn why they are important.
We'll cover the following
Earlier, we saw that image names include a name and a tag. As a quick reminder, an image name is:
<repository_name>/<name>:<tag>
- tag is optional; when missing, it is considered to be latest by default
- repository_name can be a registry DNS or the name of a registry in the Docker Hub
While your images aren’t published to a registry, you don’t need to include a registry name. So, your image name is:
<name>:<tag>
The latest tag
In my demonstrations I didn’t include a tag; therefore the default latest tag was used. For instance, the actual image name was hello:latest when I ran the following command:
Get hands-on with 1400+ tech skills courses.