需要连接网络,从docker hub上拉取信息,关于manifest信息 打印出来。不连接网络会报错。
注意:此命令在 Docker 客户端上是实验性的。
它不应在生产环境中使用。
官方文档地址:https://docs.docker.com/engine/reference/commandline/manifest/
我的理解:docker hub社区的镜像维护,让他人直观的了解你构建的镜像。
就是 docker image inspect
$ docker manifest COMMAND COMMAND扩展描述
该命令本身不执行任何 *** 作。为了对清单或清单列表进行 *** 作,必须使用其中一个子命令。docker manifest
单个清单是有关图像的信息,例如图层、大小和摘要。docker 清单命令还为用户提供了其他信息,例如构建映像的 os 和体系结构。
清单列表是通过指定一个或多个(理想情况下是多个)图像名称创建的映像层的列表。然后,可以将其用作 与 中的映像名称 和 命令相同的方式。docker pull docker run
理想情况下,清单列表是从功能相同的图像创建的,用于不同的os/arch组合。因此,清单列表通常称为"多架构映像"。但是,用户可以创建一个指向两个映像的清单列表 - 一个用于 amd64 上的 Windows,另一个用于 amd64 上的 darwin。
$ docker manifest Usage: docker manifest COMMAND The **docker manifest** command has subcommands for managing image manifests and manifest lists. A manifest list allows you to use one name to refer to the same image built for multiple architectures. To see help for a subcommand, use: docker manifest CMD --help For full details on using docker manifest lists, see the registry v2 specification. EXPERIMENTAL: docker manifest 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/ Commands: annotate Add additional information to a local image manifest create Create a local manifest list for annotating and pushing to a registry inspect Display an image manifest, or manifest list push Push a manifest list to a repository rm Delete one or more manifest lists from local storage Run 'docker manifest COMMAND --help' for more information on a command.manifest inspect 清单检查
$ docker manifest inspect --help Usage: docker manifest inspect [OPTIONS] [MANIFEST_LIST] MANIFEST Display an image manifest, or manifest list Options: --insecure Allow communication with an insecure registry -v, --verbose Output additional info including layers and platformmanifest create 清单创建
$ docker manifest create --help Usage: docker manifest create MANIFEST_LIST MANIFEST [MANIFEST...] Create a local manifest list for annotating and pushing to a registry Options: -a, --amend Amend an existing manifest list --insecure Allow communication with an insecure registrymanifest annotate 清单注释
$ docker manifest annotate --help Usage: docker manifest annotate [OPTIONS] MANIFEST_LIST MANIFEST Add additional information to a local image manifest Options: --arch string Set architecture --os string Set operating system --os-features strings Set operating system feature --os-version string Set operating system version --variant string Set architecture variantmanifest push 清单推送
$ docker manifest push --help Usage: docker manifest push [OPTIONS] MANIFEST_LIST Push a manifest list to a repository Options: --insecure Allow push to an insecure registry -p, --purge Remove the local manifest list after push使用不安全的注册表
manifest 命令仅与 Docker 注册表交互。因此,它无法向引擎查询允许的不安全注册表列表。为了允许 CLI 与不安全的注册表交互,一些docker manifest 命令有一个--insecure标志。对于查询注册表的每个事务,例如 create,--insecure必须指定标志。此标志告诉 CLI,此注册表调用可能会忽略丢失或自签名证书等安全问题。同样,在manifest push不安全的注册表上,--insecure必须指定标志。如果这不与不安全的注册表一起使用,则清单命令将无法找到满足默认要求的注册表。
示例 查看镜像清单查看docker hub 上 hello-world 镜像
$ docker manifest inspect hello-world { "schemaVersion": 2, "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json", "manifests": [ { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "size": 525, "digest": "sha256:f54a58bc1aac5ea1a25d796ae155dc228b3f0e11d046ae276b39c4bf2f13d8c4", "platform": { "architecture": "amd64", "os": "linux" } }, { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "size": 525, "digest": "sha256:7b8b7289d0536a08eabdf71c20246e23f7116641db7e1d278592236ea4dcb30c", "platform": { "architecture": "arm", "os": "linux", "variant": "v5" } }, { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "size": 525, "digest": "sha256:f130bd2d67e6e9280ac6d0a6c83857bfaf70234e8ef4236876eccfbd30973b1c", "platform": { "architecture": "arm", "os": "linux", "variant": "v7" } }, { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "size": 525, "digest": "sha256:01433e86a06b752f228e3c17394169a5e21a0995f153268a9b36a16d4f2b2184", "platform": { "architecture": "arm64", "os": "linux", "variant": "v8" } }, { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "size": 525, "digest": "sha256:251bb7a536c7cce3437758971aab3a31c6da52fb43ff0654cff5b167c4486409", "platform": { "architecture": "386", "os": "linux" } }, { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "size": 525, "digest": "sha256:c2f204d26b4ea353651385001bb6bc371d8c4edcd9daf61d00ad365d927e00c0", "platform": { "architecture": "mips64le", "os": "linux" } }, { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "size": 525, "digest": "sha256:b836bb24a270b9cc935962d8228517fde0f16990e88893d935efcb1b14c0017a", "platform": { "architecture": "ppc64le", "os": "linux" } }, { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "size": 525, "digest": "sha256:98c9722322be649df94780d3fbe594fce7996234b259f27eac9428b84050c849", "platform": { "architecture": "riscv64", "os": "linux" } }, { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "size": 525, "digest": "sha256:c7b6944911848ce39b44ed660d95fb54d69bbd531de724c7ce6fc9f743c0b861", "platform": { "architecture": "s390x", "os": "linux" } }, { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "size": 1125, "digest": "sha256:7e9c5b2a36bdd391c713b800eb7ac7047207f04faf92ec4aff8667c85540b41b", "platform": { "architecture": "amd64", "os": "windows", "os.version": "10.0.20348.473" } }, { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "size": 1125, "digest": "sha256:b17da88a43678dd8de2c335b977330a5f4e3f1175251a4204f54ef2ed1360709", "platform": { "architecture": "amd64", "os": "windows", "os.version": "10.0.17763.2458" } } ] }查看镜像清单,获取os/arch信息
--verbose,该参数提供图像的名称(Ref)、体系结构和 *** 作系统(平台)。
$ docker manifest inspect --verbose hello-world [ { "Ref": "docker.io/library/hello-world:latest@sha256:f54a58bc1aac5ea1a25d796ae155dc228b3f0e11d046ae276b39c4bf2f13d8c4", "Descriptor": { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "digest": "sha256:f54a58bc1aac5ea1a25d796ae155dc228b3f0e11d046ae276b39c4bf2f13d8c4", "size": 525, "platform": { "architecture": "amd64", "os": "linux" } }, "SchemaV2Manifest": { "schemaVersion": 2, "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "config": { "mediaType": "application/vnd.docker.container.image.v1+json", "size": 1469, "digest": "sha256:feb5d9fea6a5e9606aa995e879d862b825965ba48de054caab5ef356dc6b3412" }, "layers": [ { "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", "size": 2479, "digest": "sha256:2db29710123e3e53a794f2694094b9b4338aa9ee5c40b930cb8063a1be392c54" } ] } }, { "Ref": "docker.io/library/hello-world:latest@sha256:7b8b7289d0536a08eabdf71c20246e23f7116641db7e1d278592236ea4dcb30c", "Descriptor": { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "digest": "sha256:7b8b7289d0536a08eabdf71c20246e23f7116641db7e1d278592236ea4dcb30c", "size": 525, "platform": { "architecture": "arm", "os": "linux", "variant": "v5" } }, "SchemaV2Manifest": { "schemaVersion": 2, "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "config": { "mediaType": "application/vnd.docker.container.image.v1+json", "size": 1482, "digest": "sha256:c0218de6585df06a66d67b25237bdda42137c727c367373a32639710c7a9fa94" }, "layers": [ { "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", "size": 3684, "digest": "sha256:b921b04d0447ddcd82a9220d887cd146f6ef39e20a938ee5e19a90fc3323e030" } ] } }, { "Ref": "docker.io/library/hello-world:latest@sha256:f130bd2d67e6e9280ac6d0a6c83857bfaf70234e8ef4236876eccfbd30973b1c", "Descriptor": { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "digest": "sha256:f130bd2d67e6e9280ac6d0a6c83857bfaf70234e8ef4236876eccfbd30973b1c", "size": 525, "platform": { "architecture": "arm", "os": "linux", "variant": "v7" } }, "SchemaV2Manifest": { "schemaVersion": 2, "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "config": { "mediaType": "application/vnd.docker.container.image.v1+json", "size": 1482, "digest": "sha256:1ec996c686eb87d8f091080ec29dd1862b39b5822ddfd8f9a1e2c9288fad89fe" }, "layers": [ { "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", "size": 2993, "digest": "sha256:9b157615502ddff86482f7fe2fa7a074db74a62fce12b4e8507827ac8f08d0ce" } ] } }, { "Ref": "docker.io/library/hello-world:latest@sha256:01433e86a06b752f228e3c17394169a5e21a0995f153268a9b36a16d4f2b2184", "Descriptor": { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "digest": "sha256:01433e86a06b752f228e3c17394169a5e21a0995f153268a9b36a16d4f2b2184", "size": 525, "platform": { "architecture": "arm64", "os": "linux", "variant": "v8" } }, "SchemaV2Manifest": { "schemaVersion": 2, "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "config": { "mediaType": "application/vnd.docker.container.image.v1+json", "size": 1483, "digest": "sha256:18e5af7904737ba5ef7fbbd7d59de5ebe6c4437907bd7fc436bf9b3ef3149ea9" }, "layers": [ { "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", "size": 3208, "digest": "sha256:93288797bd35d114f2d788e5abf4fae518a5bd299647daf4ede47acc029d66c5" } ] } }, { "Ref": "docker.io/library/hello-world:latest@sha256:251bb7a536c7cce3437758971aab3a31c6da52fb43ff0654cff5b167c4486409", "Descriptor": { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "digest": "sha256:251bb7a536c7cce3437758971aab3a31c6da52fb43ff0654cff5b167c4486409", "size": 525, "platform": { "architecture": "386", "os": "linux" } }, "SchemaV2Manifest": { "schemaVersion": 2, "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "config": { "mediaType": "application/vnd.docker.container.image.v1+json", "size": 1467, "digest": "sha256:7c2f8335a1a3faa411d45fc31419e2fbb519dd9c41ece8ebc350e6fe7af6b017" }, "layers": [ { "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", "size": 2735, "digest": "sha256:cdfa10f2a818a2f4fcb49da487dc42795690a7fb04524bdc3decfa9fe16b2c2a" } ] } }, { "Ref": "docker.io/library/hello-world:latest@sha256:c2f204d26b4ea353651385001bb6bc371d8c4edcd9daf61d00ad365d927e00c0", "Descriptor": { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "digest": "sha256:c2f204d26b4ea353651385001bb6bc371d8c4edcd9daf61d00ad365d927e00c0", "size": 525, "platform": { "architecture": "mips64le", "os": "linux" } }, "SchemaV2Manifest": { "schemaVersion": 2, "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "config": { "mediaType": "application/vnd.docker.container.image.v1+json", "size": 1472, "digest": "sha256:4d278d00d38a32c6096213745a79ff5c1f6ec12b575ed0f5e5a780a3478c1b21" }, "layers": [ { "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", "size": 4091, "digest": "sha256:3e4037a0f36c739a8a3f2184b76b57f6a1d56a36fe3c3f966657ad1db828e1aa" } ] } }, { "Ref": "docker.io/library/hello-world:latest@sha256:b836bb24a270b9cc935962d8228517fde0f16990e88893d935efcb1b14c0017a", "Descriptor": { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "digest": "sha256:b836bb24a270b9cc935962d8228517fde0f16990e88893d935efcb1b14c0017a", "size": 525, "platform": { "architecture": "ppc64le", "os": "linux" } }, "SchemaV2Manifest": { "schemaVersion": 2, "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "config": { "mediaType": "application/vnd.docker.container.image.v1+json", "size": 1471, "digest": "sha256:61fff98d5ca765a4351964c8f4b5fb1a0d2c48458026f5452a389eb52d146fe8" }, "layers": [ { "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", "size": 3929, "digest": "sha256:33450689bfb495ed64ead935c9933f1d6b3e42fe369b8de9680cf4ff9d89ce5c" } ] } }, { "Ref": "docker.io/library/hello-world:latest@sha256:98c9722322be649df94780d3fbe594fce7996234b259f27eac9428b84050c849", "Descriptor": { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "digest": "sha256:98c9722322be649df94780d3fbe594fce7996234b259f27eac9428b84050c849", "size": 525, "platform": { "architecture": "riscv64", "os": "linux" } }, "SchemaV2Manifest": { "schemaVersion": 2, "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "config": { "mediaType": "application/vnd.docker.container.image.v1+json", "size": 1471, "digest": "sha256:b3593dab05491cdf5ee88c29bee36603c0df0bc34798eed5067f6e1335a9d391" }, "layers": [ { "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", "size": 3000, "digest": "sha256:3caa6dc69d0b73f21d29bfa75356395f2695a7abad34f010656740e90ddce399" } ] } }, { "Ref": "docker.io/library/hello-world:latest@sha256:c7b6944911848ce39b44ed660d95fb54d69bbd531de724c7ce6fc9f743c0b861", "Descriptor": { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "digest": "sha256:c7b6944911848ce39b44ed660d95fb54d69bbd531de724c7ce6fc9f743c0b861", "size": 525, "platform": { "architecture": "s390x", "os": "linux" } }, "SchemaV2Manifest": { "schemaVersion": 2, "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "config": { "mediaType": "application/vnd.docker.container.image.v1+json", "size": 1469, "digest": "sha256:df5477cea5582b0ae6a31de2d1c9bbacb506091f42a3b0fe77a209006f409fd8" }, "layers": [ { "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", "size": 3276, "digest": "sha256:abc70fcc95b2f52b325d69cc5c259dd9babb40a9df152e88b286fada1d3248bd" } ] } }, { "Ref": "docker.io/library/hello-world:latest@sha256:7e9c5b2a36bdd391c713b800eb7ac7047207f04faf92ec4aff8667c85540b41b", "Descriptor": { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "digest": "sha256:7e9c5b2a36bdd391c713b800eb7ac7047207f04faf92ec4aff8667c85540b41b", "size": 1125, "platform": { "architecture": "amd64", "os": "windows", "os.version": "10.0.20348.473" } }, "SchemaV2Manifest": { "schemaVersion": 2, "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "config": { "mediaType": "application/vnd.docker.container.image.v1+json", "size": 1686, "digest": "sha256:618fd25c1455708b34f08ed8354f2131f471ca8ad310b8a22b6a5ebfd2b64e23" }, "layers": [ { "mediaType": "application/vnd.docker.image.rootfs.foreign.diff.tar.gzip", "size": 117333150, "digest": "sha256:7691725ee3658d154f940d82fd8c3ff07c0dc589a0c9a93df47ed0ede92a76ab", "urls": [ "https://mcr.microsoft.com/v2/windows/nanoserver/blobs/sha256:7691725ee3658d154f940d82fd8c3ff07c0dc589a0c9a93df47ed0ede92a76ab" ] }, { "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", "size": 1871, "digest": "sha256:bfef10deb78a77121ec999eeec2bb3c2f65e023e0ea7b6e64deb72ebc25791c3" }, { "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", "size": 1162, "digest": "sha256:fdae4e65c07ded85b7bbfab7eccfc2043f5892407e48ded900879c6c9ebd24db" } ] } }, { "Ref": "docker.io/library/hello-world:latest@sha256:b17da88a43678dd8de2c335b977330a5f4e3f1175251a4204f54ef2ed1360709", "Descriptor": { "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "digest": "sha256:b17da88a43678dd8de2c335b977330a5f4e3f1175251a4204f54ef2ed1360709", "size": 1125, "platform": { "architecture": "amd64", "os": "windows", "os.version": "10.0.17763.2458" } }, "SchemaV2Manifest": { "schemaVersion": 2, "mediaType": "application/vnd.docker.distribution.manifest.v2+json", "config": { "mediaType": "application/vnd.docker.container.image.v1+json", "size": 1683, "digest": "sha256:bbca594eee38d2bcbda18490d2667560b2452e74e73b8c26bddea59cb6920ad1" }, "layers": [ { "mediaType": "application/vnd.docker.image.rootfs.foreign.diff.tar.gzip", "size": 103046552, "digest": "sha256:b5c97e1d373f591225559869af7f4f01399c201f89d21f903b1d23c830aa0a3f", "urls": [ "https://mcr.microsoft.com/v2/windows/nanoserver/blobs/sha256:b5c97e1d373f591225559869af7f4f01399c201f89d21f903b1d23c830aa0a3f" ] }, { "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", "size": 1891, "digest": "sha256:149cdce3523df21ea29ed7f0fc0b1b9649bb7fc1e0ce8417bdaa204ce40cde33" }, { "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip", "size": 1172, "digest": "sha256:2ec547840b7459a5ed163f9bfd7cc09526cec5d72875737d576c0a6e489c295d" } ] } } ]创建并推送清单列表
要创建清单列表,首先create通过指定要包含在清单列表中的组成图像在本地创建清单列表。请记住,这是推送到注册表的,因此如果您想推送到 docker 注册表以外的注册表,则需要使用注册表名称或 IP 和端口创建清单列表。这类似于标记图像并将其推送到外部注册表。
创建清单列表的本地副本后,您可以选择 annotate它。允许的注释是架构和 *** 作系统(覆盖图像的当前值)、 *** 作系统特性和架构变体。
最后,您需要将push您的清单列表添加到所需的注册表中。下面是对这三个命令的描述,以及将它们组合在一起的示例。
$ docker manifest create 45.55.81.106:5000/coolapp:v1 45.55.81.106:5000/coolapp-ppc64le-linux:v1 45.55.81.106:5000/coolapp-arm-linux:v1 45.55.81.106:5000/coolapp-amd64-linux:v1 45.55.81.106:5000/coolapp-amd64-windows:v1 Created manifest list 45.55. 81.106: 5000/ coolapp:v1
$ docker manifest annotate 45.55.81.106:5000/coolapp:v1 45.55.81.106:5000/coolapp-arm-linux --arch arm
$ docker manifest push 45.55.81.106:5000/coolapp:v1检查清单
$ docker manifest inspect coolapp:v1
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)