LinuxCommandLibrary

crane-index-append

Append an image to an OCI index

TLDR

Append manifest to a remote index

$ crane index append
copy

Reference to manifests to append to the base index
$ crane index append [[-m|--manifest]] [manifest_name1 manifest_name2 ...]
copy

Tag to apply to resulting image
$ crane index append [[-t|--tag]] [tag_name]
copy

Empty base index will have Docker media types instead of OCI
$ crane index append --docker-empty-base
copy

Append each of its children rather than the index itself (defaults true)
$ crane index append --flatten
copy

Display help
$ crane index append [[-h|--help]]
copy

SYNOPSIS

crane index append <existing_index.json> <image_ref1> <image_ref2> ... <output_index.json>

PARAMETERS

existing_index.json
    The path to the existing OCI index file that will be modified.

image_ref1 image_ref2 ...
    One or more container image references (e.g., `docker.io/library/ubuntu:latest`) to be added to the index.

output_index.json
    The path to the file where the modified OCI index will be written.

DESCRIPTION

The `crane index append` command is used to modify an existing OCI index file by adding references to one or more container images. This is useful for creating multi-architecture or variant images, where a single index points to different image manifests based on the client's platform. It effectively aggregates different images under a single tag or reference, allowing for more flexible image distribution. The command takes an existing index file as input, and the images that are going to be added. It generates the modified index file as output.

EXAMPLE

To append `ubuntu:latest` and `alpine:latest` images to an existing index file named `my_index.json` and save the result as `new_index.json`, use:
crane index append my_index.json docker.io/library/ubuntu:latest docker.io/library/alpine:latest new_index.json

Copied to clipboard