Description
OCI archives without manifest descriptor annotations fail to load with Error: internalError: "Failed to import image". Per the OCI Image Spec, these annotations are optional.
Reproduction
- Create an OCI archive without manifest descriptor annotations (e.g., using nix2container)
- Run
container i load -i archive.tar
- Result:
Error: internalError: "Failed to import image"
Root Cause
LocalOCILayoutClient.getImageReferencefromDescriptor returns nil when annotations are missing, causing the manifest to be skipped in the import loop (ImageStore+OCILayout.swift:82-85).
Possible Solutions
- Use archive filename for image name, then fall back to digest-based reference:
"untagged@\(descriptor.digest)"
- Add a
--ref name:tag flag to container i load for specifying the image name and tag
- Provide a clearer error message explaining annotations are required
Docker/Podman handle this by displaying untagged images as <none>:<none>.