My dockerfile
uses a multi-stage build, and I want to cache one of the stages to speed up image buildings.
Basically, my kaniko pod and my dockerfile works fine if I don't use the warmer to cache the images and mount the /cache
volume.
But if I cache the intermediate stage using the warmer to a PVC, then mount that PVC to the kaniko executor, I will get this error when trying to push images to the remote container registry.
MANIFEST_INVALID: manifest invalid; map[Reason:map[]]
I set up a local container registry and let kaniko pushes to it, and I got these error logs on the container registry.
err.code="manifest invalid" err.detail="mediaType in manifest should be 'application/vnd.docker.distribution.manifest.v2+json' not 'application/vnd.oci.image.manifest.v1+json'" err.message="manifest invalid" go.version=go1.19.9 http.request.contenttype="application/vnd.docker.distribution.manifest.v2+json"
On github, I found a opening bug related to kaniko + oci, https://github.com/GoogleContainerTools/kaniko/issues/1836. But I am not sure if my issue is related.