BertC
BertC

Reputation: 2656

2 Docker images, different TAG have the same IMAGE ID

Why do 2 docker images with a different TAG have the same IMAGE ID?

My idea of IMAGE ID was that this is unique for the image/tag.

$ docker images | grep -e "airflow" -e "IMAGE"
REPOSITORY                  TAG              IMAGE ID       CREATED        SIZE
bitnami/airflow             2                28660a21473c   2 weeks ago    2.12GB
bitnami/airflow             2.2.5            28660a21473c   2 weeks ago    2.12GB

Upvotes: 0

Views: 1065

Answers (1)

BMitch
BMitch

Reputation: 263637

The image id is based on a hash of the image config. That config uniquely identifies an image since it not only contains all settings of the image, but also hashes of the filesystem layers that make up the image.

Tags, both on docker and in registries (though they reference a slightly different thing) are pointers to that unique digest. Multiple pointers can be made to the same digest, and one pointer can be modified to point to a new digest.

Upvotes: 2

Related Questions