Skip to content

[Request]: container image load cannot load legacy Docker tarfiles created by the Google Jib Gradle plugin. #1426

Description

@jglogan

Feature or enhancement request details

When I use the reproduction example below to create a simple jib image, I'm unable to load the resulting tarfile into container.

% gradle jibBuildTar                               

> Task :jibBuildTar

...

BUILD SUCCESSFUL in 6s
2 actionable tasks: 1 executed, 1 up-to-date

% container image load -i ./build/jib-image.tar
Error: /var/folders/6k/tnyh0vfd07z0f9mr5cg7zs5r0000gn/T/4278F53C-9ED8-4F46-9354-F2B465C970C9/oci-layout

Reproducer: 20260417-tiny-jib.tgz

We could consider handling this in a utility somewhere within container that converts an unpacked docker image archive into an OCI archive in-place, instead of adding support for the legacy docker format in the Containerization image store itself.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added theissue type on Apr 17, 2026
  2. mvanhorn commented on Apr 29, 2026

    @mvanhorn
    Contributor

    Considering taking this. The plan I'd propose:

    1. In ImagesService.load(from:force:) (Sources/Services/ContainerImagesService/Server/ImagesService.swift), after reader.extractContents(to: tempDir), detect the archive layout:

      • tempDir/oci-layout present -> already OCI, no-op
      • tempDir/manifest.json present -> docker-archive, convert in place
      • neither -> fall through to current behavior (existing oci-layout error, no regression)
    2. The conversion would parse manifest.json, hash the config + layer files into blobs/sha256/<digest>, build OCI manifests + index.json, and write oci-layout so the existing imageStore.load(from: tempDir) call works unchanged. Conversion stays in apple/container per your suggestion in the issue body.

    The Jib reproducer attached to the issue is what I'd use as the test fixture.

    A couple of quick design questions before I open a PR:

    • Multi-tag manifest.json handling - I'd build one OCI manifest per entry and reference all of them from index.json. Match expectations?
    • Any preference between (a) doing conversion only when oci-layout is absent and manifest.json is present, or (b) detecting via the mediaType field in manifest.json's entries?

    Happy to send a PR if this lines up with the direction you have in mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions