简体   繁体   English

具有 2 个不同 SHA256 摘要的 Docker 映像

[英]Docker image with 2 different SHA256 digests

What does it mean when inspect shows two RepoDigests values for a Docker image?inspect显示 Docker 映像的两个RepoDigests值时,这意味着什么?

Example:例子:

$ docker inspect aquasec/trivy:latest
[
    {
        "Id": "sha256:33106c9ec694a2e9057fb80a5451f4648ed67d6159cc034fa6340f4cfbe2b98a",
        "RepoTags": [
            "aquasec/trivy:latest"
        ],
        "RepoDigests": [
            "aquasec/trivy@sha256:76d47e5917c583fcad5ab4f83a23cb5e534c34649a994c73722fe6dfd86f2855",
            "aquasec/trivy@sha256:c0d08ac683a0e36ac71555314140718cd8d224efb70a5ebe388ad5879be56445"
        ],
...
]

When I go to Docker Hub , only the c0d08ac683a0 is shown.当我转到Docker Hub 时,只显示了c0d08ac683a0

aquasec/trivy is distributed as a multi-platform image. aquasec/trivy作为多平台映像分发。 The first one in your list is from the manifest list itself, and the second digest is for your specific platform:您列表中的第一个来自清单列表本身,第二个摘要针对您的特定平台:

$ regctl manifest get --list aquasec/trivy
Name:        aquasec/trivy
MediaType:   application/vnd.docker.distribution.manifest.list.v2+json
Digest:      sha256:76d47e5917c583fcad5ab4f83a23cb5e534c34649a994c73722fe6dfd86f2855
             
Manifests:   
             
  Name:      docker.io/aquasec/trivy@sha256:c0d08ac683a0e36ac71555314140718cd8d224efb70a5ebe388ad5879be56445
  MediaType: application/vnd.docker.distribution.manifest.v2+json
  Platform:  linux/amd64
             
  Name:      docker.io/aquasec/trivy@sha256:5d0d4ce0af0888f77b9831172f0ec6a6f8e6b087496a5d2677426e0492224302
  MediaType: application/vnd.docker.distribution.manifest.v2+json
  Platform:  linux/arm64

The manifest list is a set of pointers to each platform manifest (and it has it's own digest):清单列表是一组指向每个平台清单的指针(它有自己的摘要):

{
  "schemaVersion": 2,
  "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
  "manifests": [
    {
      "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
      "size": 1159,
      "digest": "sha256:c0d08ac683a0e36ac71555314140718cd8d224efb70a5ebe388ad5879be56445",
      "platform": {
        "architecture": "amd64",
        "os": "linux"
      }
    },
    {
      "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
      "size": 1159,
      "digest": "sha256:5d0d4ce0af0888f77b9831172f0ec6a6f8e6b087496a5d2677426e0492224302",
      "platform": {
        "architecture": "arm64",
        "os": "linux"
      }
    }
  ]
}

And then the docker manifest for your platform includes references to the config and layer blobs:然后,您平台的 docker 清单包含对配置和层 blob 的引用:

{
  "schemaVersion": 2,
  "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
  "config": {
    "mediaType": "application/vnd.docker.container.image.v1+json",
    "size": 1820,
    "digest": "sha256:33106c9ec694a2e9057fb80a5451f4648ed67d6159cc034fa6340f4cfbe2b98a"
  },
  "layers": [
    {
      "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
      "size": 2814446,
      "digest": "sha256:a0d0a0d46f8b52473982a3c466318f479767577551a53ffc9074c9fa7035982e"
    },
    {
      "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
      "size": 6900624,
      "digest": "sha256:0df7abe0cb9353fe074cad7942ce432f7a95cc1e80a4e4f15e326f4c79af7364"
    },
    {
      "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
      "size": 13101667,
      "digest": "sha256:49b8248ae36d0bf5eefe15d56704da18a3239db65bb82d5e73426dafbc16e7df"
    },
    {
      "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
      "size": 4268,
      "digest": "sha256:33a14db32fe04bfed4ebca691c13c0947b2bbceb9ae68c5118435b9dbaf4dfcd"
    }
  ]
}

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

相关问题 docker 镜像的 sha256 哈希值在存储库之间是否不同? - Is the sha256 hash of a docker image different between repositories? sha256本地建造的码头图像 - sha256 of locally built docker image 删除 Docker 镜像时的 sha256 存储库是什么? - What are the sha256 repositories when deleting a Docker image? 我在哪里可以找到 docker 镜像的 sha256 代码? - Where can I find the sha256 code of a docker image? Docker 构建失败 -- 如何通过 sha256 运行图像 hash? - Docker build failure -- how to run image by sha256 hash? 在Docker中sha256是什么意思,图像层的目录在哪里? - What does it mean sha256 in Docker, where are directories of layers of image? 亚马逊 EMR spark-submit 不允许 docker 图像模式 sha256 diges - amazon EMR spark-submit doesn't allow docker Image pattern sha256 diges Docker镜像的ID和sha256与此字段相关以及如何生成 - Docker image's ID and sha256 are this field related and how generated 从私有 docker 注册表中拉取图像会导致摘要 sha256 的文件系统层验证失败: - pulling image from private docker registry causes filesystem layer verification failed for digest sha256: 如果将具有相同标签的同一图像多次推送到同一Docker存储库,为什么Docker映像的SHA256摘要会更改 - Why SHA256 digest of Docker image changes if we push the same image with same tag multiple times to the same docker repository
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM