简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM