1. docker manifest inspect

1.1. 描述

查看普通镜像或多架构镜像的详细信息。

1.2. 帮助

# docker manifest inspect  --help

Usage:  docker manifest inspect [OPTIONS] [MANIFEST_LIST] MANIFEST

Display an image manifest, or manifest list

EXPERIMENTAL:
  docker manifest inspect is an experimental feature.
  Experimental features provide early access to product functionality. These
  features may change between releases without warning, or can be removed from a
  future release. Learn more about experimental features in our documentation:
  https://docs.docker.com/go/experimental/

Options:
      --insecure   Allow communication with an insecure registry
  -v, --verbose    Output additional info including layers and platform

1.3. 选项

名称,简写 默认值 描述
--insecure - 允许使用不安全的(非合法证书的 https)镜像仓库
-v, --verbose - 输出额外的信息,包括层和平台

1.4. 示例

  • 将 redis 的 arm64 和 amd64 镜像构建成一个多架构镜像
# docker manifest create harbor.cncfstack.com/library/redis:6.2.6-multi harbor.cncfstack.com/library/redis:6.2.6-amd64 harbor.cncfstack.com/library/redis:6.2.6-arm64
Created manifest list harbor.cncfstack.com/library/redis:6.2.6-multi

构建完成后,可以使用 docker manifest inspect 查看多架构镜像信息

# docker manifest inspect harbor.cncfstack.com/library/redis:6.2.6-multi
{
   "schemaVersion": 2,
   "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
   "manifests": [
      {
         "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
         "size": 1573,
         "digest": "sha256:3991cfe7ed07a7080c79a3b52e38e81caf13f9aa013b0bf588807f4637176515",
         "platform": {
            "architecture": "amd64",
            "os": "linux"
         }
      },
      {
         "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
         "size": 1572,
         "digest": "sha256:6c1a95df60f12a3b014fa5c85a9c04e742eb2686db2a9f212d49974188ebf0ec",
         "platform": {
            "architecture": "arm64",
            "os": "linux",
            "variant": "v8"
         }
      }
   ]
}

然后使用 docker manifest push 将多架构镜像信息推送远程仓库

# docker manifest push  harbor.cncfstack.com/library/redis:6.2.6-multi
sha256:89762437568f959988bcd9aefe08a8b41d6031defac406a3d9e0281efe07177a

1.5. 参考

Copyright © 温玉 2021 | 浙ICP备2020032454号 all right reserved,powered by Gitbook该文件修订时间: 2022-03-18 03:15:54

results matching ""

    No results matching ""