从 DockerHub 拉取 Docker 镜像时,CLI 会显示几个进度条,每个进度条都有不同的 ID:
➜ docker pull training/sinatra
Using default tag: latest
latest: Pulling from training/sinatra
a3ed95caeb02: Pull complete
6e71c809542e: Downloading [============> ] 17.3 MB/67.48 MB
d196a7609355: Download complete
08f6dff5acea: Download complete
ce65532003d0: Downloading [==============================> ] 19.24 MB/21.22 MB
54bcaa4d1a10: Downloading [=====> ] 25.39 MB/62.67 MB
8572ad96f6e1: Waiting
下载完成后,这些 ID 都不是下载的图像 ID:
docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
...
training/webapp latest 6fae60ef3446 16 months ago 348.8 MB
training/sinatra latest 49d952a36c58 2 years ago 447 MB
下载过程中显示的 ID 代表什么?
最佳答案
简短回答:拉取镜像时看到的 ID 是“摘要”,它是每个镜像层的 SHA256 哈希值。出现在本地镜像列表中的镜像 ID 也是一个“摘要”,该摘要实际上表示镜像 JSON 配置对象的 SHA256 哈希值。
关于docker - 拉取 Docker 镜像时显示的 ID 有何含义?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39811090/