educative.io

Is an image of two tags stored twice?

Does this mean the same image of ID d5e1e48cf932 is stored as two copies locally or is it just listing the same image twice because of double-tagging? Asking because the lesson said “the command pulled three images”.
$ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
nigelpoulton/tu-demo latest d5e1e48cf932 2 weeks ago 104MB
nigelpoulton/tu-demo v2 d5e1e48cf932 2 weeks ago 104MB
nigelpoulton/tu-demo v1 6852022de69d 2 weeks ago 104MB


Course: The Beginners Guide to Docker - Learn Interactively
Lesson: Images with Multiple Tags - The Beginners Guide to Docker

Hi @Rui_Li !!
Here the same image with the ID “d5e1e48cf932” is stored as two copies locally. Both the “latest” and “v2” tags refer to the same image, which explains why they have the same IMAGE ID. The presence of multiple tags for the same image allows different versions or references to be associated with it. However, it’s important to note that the “latest” tag does not necessarily represent the newest version of the image and should not be solely relied upon for determining the latest image in a repository.
I hope it helps. Happy Learning :blush: