Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use OCI manifest format for images from scratch #2013

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Silvanoc
Copy link

@Silvanoc Silvanoc commented Sep 19, 2024

Images built from scratch where still using the outdated Docker v2 image format (recognizable in the mediaType application/vnd.docker.distribution.manifest.v2+json). This patch replaces that outdate format with the current one based in the OCI standard (marked by the mediaType application/vnd.oci.image.manifest.v1+json).

A 7-months old statement from Docker stating

The v1 file layout and manifests are no longer used in Moby and Docker, except in docker save and docker load.

I suppose the CLA I needed for an older Kaniko contribution is also valid for this one.

Fixes #2012

Images built from scratch where still using the outdated Docker v2 image
format (recognizable in the mediaType `application/vnd.docker.distribution.manifest.v2+json`).
This patch replaces that outdate format with the current one based in
the OCI standard (marked by the mediaType `application/vnd.oci.image.manifest.v1+json`).

Signed-off-by: Silvano Cirujano Cuesta <[email protected]>
@jonjohnsonjr
Copy link
Collaborator

The v1 file layout and manifests are no longer used in Moby and Docker, except in docker save and docker load.

The v1 file layout is not the same as docker schema 2, which is modern and ~equivalent to OCI v1.

@Silvanoc
Copy link
Author

The v1 file layout and manifests are no longer used in Moby and Docker, except in docker save and docker load.

The v1 file layout is not the same as docker schema 2, which is modern and ~equivalent to OCI v1.

You are right on that. Nevertheless, the issue remains, that Docker image v2 is not conformant with OCI v1 and therefore some tools that are OCI-only will have issues with them.

Now the question is if this projects wants to stay consistent with the IMHO Docker inconsistent behavior on images built from scratch compared with those available in the Docker Hub Library. Apparently the change in the Library is quite new (last 3 months or so), so perhaps BuildX will adapt its behavior building from scratch in the upcoming future.

@Silvanoc
Copy link
Author

Now the question is if this projects wants to stay consistent with the IMHO Docker inconsistent behavior on images built from scratch compared with those available in the Docker Hub Library. Apparently the change in the Library is quite new (last 3 months or so), so perhaps BuildX will adapt its behavior building from scratch in the upcoming future.

I am mixing here the fact that BuildKit is being developed by the Moby project and Docker BuildX is surely simply taking over their default, whereas the Docker Hub is directly being provided by Docker Inc. So possibly Docker Inc. is also unhappy with the mixture.

@Silvanoc
Copy link
Author

Silvanoc commented Nov 18, 2024

It looks to me as if Docker schema v2 should be replaced by OCI v1, even in Moby: https://github.com/moby/buildkit/blob/5cd5a63de5d37512c24f20085607509b749df762/exporter/containerimage/writer.go#L490

Therefore I'd assume that sooner or later, also images built from scratch with BuildKit will have OCI v1 format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants