Skip to content

feat: mocker manifest command for multi-arch OCI image index assembly #9

@kaovilai

Description

@kaovilai

Problem

mocker build --platform <os/arch> successfully builds per-architecture images (amd64, arm64, ppc64le all confirmed working). However, there is no way to assemble these into a multi-architecture OCI Image Index (manifest list) for publication.

# These all work today:
mocker build --platform linux/amd64  -t test-amd64:latest  .
mocker build --platform linux/arm64  -t test-arm64:latest  .
mocker build --platform linux/ppc64le -t test-ppc64le:latest .

# This does not exist:
mocker manifest create test-multiarch:latest         # ← unknown command
mocker manifest add test-multiarch:latest test-amd64:latest
mocker manifest push test-multiarch:latest

Upstream tracking

Apple upstream issue filed: apple/container#1495Feature: container manifest subcommand for multi-arch OCI image index creation

If Apple ships a container manifest plugin, mocker can delegate to it directly. Monitor that issue.

Proposed solution

Add a mocker manifest subcommand group matching Docker and Podman conventions:

Command Description
mocker manifest create <list> [images...] Create a new manifest list
mocker manifest add <list> <image> Add an image to the list
mocker manifest rm <list> <image> Remove an image from the list
mocker manifest inspect <list> Inspect a manifest list
mocker manifest push <list> Push manifest list to a registry
mocker manifest annotate Annotate a manifest entry

Implementation notes

Workaround today

Use skopeo to push per-arch images to a registry, then assemble a manifest list externally:

# 1. Build per-arch
mocker build --platform linux/amd64 -t myrepo/myimage:amd64 .
mocker build --platform linux/arm64 -t myrepo/myimage:arm64 .

# 2. Save + push via skopeo (skopeo handles OCI Index child manifest correctly)
mocker image save myrepo/myimage:amd64 -o amd64.tar
skopeo copy oci-archive:amd64.tar docker://myrepo/myimage:amd64

mocker image save myrepo/myimage:arm64 -o arm64.tar
skopeo copy oci-archive:arm64.tar docker://myrepo/myimage:arm64

# 3. Create manifest list (docker CLI or podman)
docker manifest create myrepo/myimage:latest \
  myrepo/myimage:amd64 myrepo/myimage:arm64
docker manifest push myrepo/myimage:latest

Related

Note

Responses generated with Claude

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions