{"id":287584,"date":"2021-06-30T14:33:31","date_gmt":"2021-06-30T11:33:31","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/what-is-a-docker-image-manifest-cloudsavvy-it\/"},"modified":"2021-06-30T14:33:31","modified_gmt":"2021-06-30T11:33:31","slug":"what-is-a-docker-image-manifest-cloudsavvy-it","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/what-is-a-docker-image-manifest-cloudsavvy-it\/","title":{"rendered":"#What Is a Docker Image Manifest? \u2013 CloudSavvy IT"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a3e55f7b9433\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a3e55f7b9433\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/what-is-a-docker-image-manifest-cloudsavvy-it\/#The_Manifest_Format\" >The Manifest Format<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/what-is-a-docker-image-manifest-cloudsavvy-it\/#Manifests_and_Multi-Arch_Builds\" >Manifests and Multi-Arch Builds<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/buradabiliyorum.com\/en\/what-is-a-docker-image-manifest-cloudsavvy-it\/#Annotating_Manifests\" >Annotating Manifests<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/buradabiliyorum.com\/en\/what-is-a-docker-image-manifest-cloudsavvy-it\/#Summary\" >Summary<\/a><\/li><\/ul><\/nav><\/div>\n<p><strong>&#8220;#What Is a Docker Image Manifest? \u2013 CloudSavvy IT&#8221;<\/strong><\/p>\n<div id=\"article-content-area\">\n<img loading=\"lazy\" decoding=\"async\" class=\"type:primaryImage aligncenter size-full wp-image-9034\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/01\/6dc7b5a0.jpeg?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"\" width=\"1602\" height=\"902\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Docker manifests describe the layers inside an image. A manifest enables exact comparison of two images, even if they have different tags assigned.<\/p>\n<p>Manifests are expressed in JSON and contain information about the image\u2019s layers and architectures. The Docker client uses manifests to work out whether an image is compatible with the current device. It then uses the information to determine how to start new containers.<\/p>\n<h2 id=\"the-manifest-format\"><span class=\"ez-toc-section\" id=\"The_Manifest_Format\"><\/span>The Manifest Format<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/docs.docker.com\/registry\/spec\/manifest-v2-2\">manifest schema<\/a> is currently at version 2. A complete file will declare its schema version and then a list of manifest entries available for the image. Each entry represents a different variant of the image, such as x86 and ARM64.<\/p>\n<p>You can view any image\u2019s manifest using the <code>docker manifest inspect<\/code> command. This works with both local images and images stored on a remote registry such as Docker Hub.<\/p>\n<pre>docker manifest inspect my-image:latest<\/pre>\n<p>The manifest is a list of layers included in the image. You can see the hash of the layer\u2019s content and its overall size.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-12333\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/06\/e8e99921.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"\" width=\"1277\" height=\"596\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>If you add the <code>--verbose<\/code> flag, you\u2019ll get even more information about the image. This includes the image\u2019s tag (in the <code>Ref<\/code> field), its architecture, and its operating system.<\/p>\n<p>Docker won\u2019t load manifest details from insecure registries by default. If you need to use an improperly secured registry, add the <code>--insecure<\/code> flag to your <code>docker manifest<\/code> commands.<\/p>\n<h2 id=\"manifests-and-multi-arch-builds\"><span class=\"ez-toc-section\" id=\"Manifests_and_Multi-Arch_Builds\"><\/span>Manifests and Multi-Arch Builds<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Historically, Docker didn\u2019t support multiple image architectures. Images could only be used on machines with the same architecture as the one they were built on. This quickly proved limiting as Docker found more use in server environments and on newer ARM-based machines.<\/p>\n<p>Besides enabling unique identification of images, manifests facilitate multi-architecture builds. If you inspect an image that supports multiple architectures, you\u2019ll see a subtly different manifest output:<\/p>\n<pre>docker manifest inspect php:latest<\/pre>\n<p>Running the command above will display the manifest for the official PHP Docker image. You can see from the screenshot that several platform options are available, including AMD64 and ARM. We\u2019ve truncated the full list which actually includes eight different supported architectures.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-12334\" src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/06\/034583c4.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"\" width=\"1277\" height=\"708\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Manifests let image authors advertise support for multiple architectures under one image tag. The Docker client selects the <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/download-scripts-themes-apps\/\" data-internallinksmanager029f6b8e52c=\"9\" title=\"Download Scripts &amp; Themes &amp; Apps\" target=\"_blank\" rel=\"noopener\">app<\/a>ropriate image version for its platform, based on the options in the list. It\u2019s expected that authors will only group images that offer identical functionality \u2013 there should be no changes beyond the target architecture or operating system.<\/p>\n<p>Each architecture in the list refers to <em>another<\/em> manifest via its <code>digest<\/code> field. The referenced manifest will be a regular single-architecture file. Docker matches the current platform to the right single-arch manifest, then loads that file to determine the final list of image layers.<\/p>\n<p>You can manually create multi-architecture images using the <code>docker manifest<\/code> command. Build each of the individual images and push them up to a registry. Then use the <code>docker manifest create<\/code> command to combine the images into a new shared manifest under a single tag.<\/p>\n<pre># on an AMD64 machine&#13;\ndocker build -t my-image:amd64 .&#13;\ndocker push my-image:amd64&#13;\n&#13;\n# on an ARM machine&#13;\ndocker build -t my-image:arm .&#13;\ndocker push my-image:arm&#13;\n&#13;\n# now combine the manifests&#13;\ndocker manifest create my-image:latest &#13;\n--amend my-image:x64&#13;\n--amend my-image:arm&#13;\ndocker manifest push my-image:latest<\/pre>\n<p>Using <code>manifest create<\/code> with the <code>--amend<\/code> flag lets you merge multiple independent manifests together. The final manifest is then pushed to Docker Hub with the <code>latest<\/code> tag. AMD64 and ARM users will both be able to create containers from this image.<\/p>\n<p>Manually assembling multi-arch images isn\u2019t mandatory. You can use the <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/github.com\/docker\/buildx\"><code>buildx<\/code> command<\/a> instead to considerably simplify the process.<\/p>\n<pre>docker buildx build --platform linux\/amd64,linux\/arm64\/v8 --tag my-image:latest<\/pre>\n<p>This single command results in an image that works on both AMD64 and ARM64 platforms. Under the hood, it\u2019s still producing a multi-arch manifest list, so it\u2019s helpful to understand the inner workings of how images get linked together.<\/p>\n<h2 id=\"annotating-manifests\"><span class=\"ez-toc-section\" id=\"Annotating_Manifests\"><\/span>Annotating Manifests<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Docker lets you manually override manifest data through annotations. The <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/docs.docker.com\/engine\/reference\/commandline\/manifest\">supported fields<\/a> include architecture and operating system information.<\/p>\n<p>Use the <code>docker manifest annotate<\/code> command to setup annotations. If you\u2019re annotating a single-architecture image, supply an image tag that references it. For multi-arch images, you\u2019ll need both the overall image tag and the tag of the individual manifest within the multi-arch manifest list.<\/p>\n<pre>docker manifest annotate my-image:latest my-image:amd64 --os-version linux<\/pre>\n<p>This command marks the AMD64 version of the <code>my-image:latest<\/code> image as a Linux-based container.<\/p>\n<p>Annotations don\u2019t often need to be set by hand. They\u2019re usually inferred automatically from the build environment. You can use the <code>annotate<\/code> command to add missing fields or change image configuration in the future.<\/p>\n<h2 id=\"summary\"><span class=\"ez-toc-section\" id=\"Summary\"><\/span>Summary<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Docker manifests describe an image\u2019s layers and the architectures it supports. A manifest can be either single architecture, supporting a specific platform, or multi-architecture. In the latter case, the file contains a list of references to the single-arch manifests it incorporates.<\/p>\n<p>Manual interaction with manifests should be rare but is possible with the <code>docker manifest<\/code> command group. It\u2019s now more common to automate multi-arch builds via Buildx, which offers a simplified manifest assembly experience.\n<\/div>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMLG0nwswvr63Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.cloudsavvyit.com\/12330\/what-is-a-docker-image-manifest\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;#What Is a Docker Image Manifest? \u2013 CloudSavvy IT&#8221; Docker manifests describe the layers inside an image. A manifest enables exact comparison of two images, even if they have different tags assigned. Manifests are expressed in JSON and contain information about the image\u2019s layers and architectures. The Docker client uses manifests to work out whether&#8230;<\/p>\n","protected":false},"author":1,"featured_media":287585,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2021\/01\/6dc7b5a0.jpeg","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-287584","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/287584","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=287584"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/287584\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/287585"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=287584"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=287584"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=287584"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}