diff --git a/pkg/build/nodeimage/internal/container/docker/archive.go b/pkg/build/nodeimage/internal/container/docker/archive.go index ebdc8fc2cd..32d4aee7ed 100644 --- a/pkg/build/nodeimage/internal/container/docker/archive.go +++ b/pkg/build/nodeimage/internal/container/docker/archive.go @@ -126,6 +126,21 @@ func EditArchive(reader io.Reader, writer io.Writer, editRepositories func(strin return err } hdr.Size = int64(len(b)) + } else if hdr.Name == "oci-layout" || hdr.Name == "index.json" { + // `docker save` in Docker v25 produces Docker/OCI dual-format archives: + // - "repositories", "manifest.json": for legacy Docker format + // - "oci-layout", "index.json" (and blobs): for OCI format + // + // However, as of Docker v25.0.0, the OCI format blobs are broken: + // https://github.com/moby/moby/issues/47150 + // + // As a workaround, we have to omit "oci-layout" and "index.json" here to + // disable the OCI format to avoid confusing `ctr images import`. + // + // When the issue above is fixed, we may add back "oci-layout" and + // "index.json" here, but we still have to make sure to update the + // "io.containerd.image.name" annotation in manifests in "index.json". + continue // edit image config when we find that } else if strings.HasSuffix(hdr.Name, ".json") { if architectureOverride != "" {