Repository navigation
Description
Feature or enhancement request details
Docker with the containerd image store (the default in recent Docker releases) keeps the full index of a multi-platform image, but only the content for platforms that were pulled. docker save writes that index as is, followed by the blobs it has. If you pull quay.io/coreos/etcd:v3.7.1 on an arm64 machine and run docker save, you get an archive like this:
index.jsonpoints at the upstream multi-platform index (linux/amd64, linux/arm64, linux/ppc64le, linux/s390x, and often attestation manifests with platformunknown/unknown).- Only the linux/arm64 manifest, config and layer blobs are present.
ImageStore.load(from:) fails on OCI image-layout archives whose index lists manifests for more platforms than the archive actually carries. For example:
$ container image load < etcd.tar
Error: missingContent("sha256:9fc5c86dedacb9612f37ff492edd642b18ffc9dab389deab4a343b1cdf217f6e")The digest is the linux/amd64 manifest. It is listed by the image index, but neither it nor its config or layers are in the archive. The error gives no indication of that.
Cause
ImportOperation.import walks the index and fetches every child with fetchAll. LocalOCILayoutClient throws missingContent for the first manifest that isn't in the archive, which aborts the whole import. Archives that point index.json directly at a single image manifest load fine.
Proposed behavior
- When importing from an OCI layout, tolerate manifests listed by an index that are not in the archive. Import the platforms that are present, and keep the original index so the stored image looks like a
pullof the native platform only. - Keep failing when a platform whose manifest is present is missing its config or layers.
- If none of the platforms listed by the index are present, fail with an error that names the missing platforms and manifest digests instead of a bare
missingContent(<digest>).
Selecting a specific platform to load (for example a --platform option in container image load) is a separate change.
Code of Conduct
- I agree to follow this project's Code of Conduct
Activity
Tolerate sparse OCI images on import. (#961)