Skip to content

ContainerImageFormat should also enforce Docker/OCI formats for layer media types, not just manifests #48639

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

Open
baronfel opened this issue Apr 22, 2025 · 0 comments
Labels
Area-Containers Related to dotnet SDK containers functionality untriaged Request triage from a team member

Comments

@baronfel
Copy link
Member

Describe the bug

It's possible today for an image created in OCI format (either explicitly with ContainerImageFormat or implicitly with multi-RID images) to have OCI-named manifest media types, but Docker-named layer media types:

{
	"schemaVersion": 2,
	"mediaType": "application/vnd.oci.image.manifest.v1+json",
	"config": {
		"mediaType": "application/vnd.oci.image.config.v1+json",
		"size": 3360,
	        "digest": "<redacted>"
	},
	"layers": [
		{
			"mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
			"size": 28227259,
			"digest": "<redacted>"
		},
		{
			"mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
			"size": 18722943,
			"digest": "<redacted>"
		},
		{
			"mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
			"size": 3278,
			"digest": "<redacted>"
		},
		{
			"mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
			"size": 32249997,
			"digest": "<redacted>"
		},
		{
			"mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
			"size": 154,
			"digest": "<redacted>"
		},
		{
			"mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
			"size": 11071998,
			"digest": "<redacted>"
		},
		{
			"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
			"size": 5430507,
			"digest": "<redacted>"
		}
	]
}

We should ensure that the layer and manifest media types are aligned when a user expresses a desire here - even though per spec mixing the two is allowed and most tooling doesn't have a problem.

@baronfel baronfel added the Area-Containers Related to dotnet SDK containers functionality label Apr 22, 2025
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Request triage from a team member label Apr 22, 2025
@baronfel baronfel changed the title ContainerImageFormat should also enforce Docker/OCI formats for _layer_ media types, not just manifests. ContainerImageFormat should also enforce Docker/OCI formats for layer media types, not just manifests Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Containers Related to dotnet SDK containers functionality untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

1 participant