简体   繁体   English

2个Docker镜像,不同的TAG有相同的IMAGE ID

[英]2 Docker images, different TAG have the same IMAGE ID

Why do 2 docker images with a different TAG have the same IMAGE ID?为什么 2 个具有不同 TAG 的 docker 图像具有相同的 IMAGE ID?

My idea of IMAGE ID was that this is unique for the image/tag.我对 IMAGE ID 的想法是,这对于图像/标签来说是独一无二的。

$ 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.图像 id 基于图像配置的哈希值。 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. docker 和注册表中的标签(尽管它们引用的内容略有不同)都是指向该唯一摘要的指针。 Multiple pointers can be made to the same digest, and one pointer can be modified to point to a new digest.可以使多个指针指向同一个摘要,并且可以修改一个指针以指向新的摘要。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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