Create a manifest list
In this step, we will learn how to create a manifest list. A manifest list is an index of image manifests, allowing you to reference multiple images for different architectures and operating systems with a single name. This is particularly useful for distributing multi-architecture images.
Before creating a manifest list, we need to have some images available. For this lab, we will use the alpine
image for different architectures. We will pull the amd64
and arm64
versions of the alpine
image.
First, pull the amd64
version of the alpine
image:
docker pull alpine:latest
You should see output indicating the image is being pulled and extracted.
Next, pull the arm64
version of the alpine
image. Note that we need to specify the platform for this pull.
docker pull --platform arm64 alpine:latest
Again, you will see output showing the image being pulled.
Now that we have the images, we can create a manifest list. We will use the docker manifest create
command. This command takes the name of the manifest list you want to create, followed by the names of the images you want to include in the list.
Let's create a manifest list named my-alpine-list
that includes the alpine:latest
(amd64) and alpine:latest
(arm64) images.
docker manifest create my-alpine-list alpine:latest alpine:latest --amend --amend
The --amend
flag is used to add or update entries in the manifest list. We use it twice here because we are adding two images.
After running this command, you have created a manifest list. However, this list is only stored locally for now. In a later step, we will push it to a registry.