Multi-Architecture Container Images: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 7: Line 7:
* [[Docker_Concepts#Multi-Architecture_Container_Image|Docker Concepts]]
* [[Docker_Concepts#Multi-Architecture_Container_Image|Docker Concepts]]
=Overview=
=Overview=
A Docker image is represented by a manifest, which is JSON-encoded content representing the image's layers, the corresponding size, the hash of the image, etc. For more details, see: {{Internal|Docker_Concepts#Image|Docker_Concepts | Image}}
A container image is represented by a manifest, which is JSON-encoded content representing the image's layers, the corresponding size, the hash of the image, etc. For more details, see: {{Internal|Docker_Concepts#Image|Docker_Concepts | Image}}
 
This format allows us to put multiple container images, each supporting a different architecture, behind the same tag.
 
We can do that with a manifest that contains a list of manifest, so the container engine can pick the one that it matches its runtime. This type of manifest is called a '''manifest list'''.
 
<syntaxhighlight lang='json'>
{
  "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
  "schemaVersion": 2,
  "manifests": [
    {
      "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
      "digest": "sha256:5...5",
      "size": 4804,
      "platform": {
        "architecture": "amd64",
        "os": "linux"
      }
    },
    {
      "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
      "digest": "sha256:4...5",
      "size": 4803,
      "platform": {
        "architecture": "arm64",
        "os": "linux"
      }
    }
  ]
}
</syntaxhighlight>

Revision as of 01:58, 13 June 2023

External

Internal

Overview

A container image is represented by a manifest, which is JSON-encoded content representing the image's layers, the corresponding size, the hash of the image, etc. For more details, see:

Docker_Concepts | Image

This format allows us to put multiple container images, each supporting a different architecture, behind the same tag.

We can do that with a manifest that contains a list of manifest, so the container engine can pick the one that it matches its runtime. This type of manifest is called a manifest list.

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