Home > Enterprise >  2 Docker images, different TAG have the same IMAGE ID
2 Docker images, different TAG have the same IMAGE ID

Time:05-19

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

CodePudding user response:

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.

  • Related