Skip to content

Add EROFS layer media type#12567

Merged
dmcgowan merged 1 commit intocontainerd:mainfrom
ChengyuZhu6:erofs-mediatype
Jan 6, 2026
Merged

Add EROFS layer media type#12567
dmcgowan merged 1 commit intocontainerd:mainfrom
ChengyuZhu6:erofs-mediatype

Conversation

@ChengyuZhu6
Copy link
Copy Markdown
Member

@ChengyuZhu6 ChengyuZhu6 commented Nov 24, 2025

It introduces "application/vnd.erofs.layer.v1" to add support for EROFS native layers, so that containerd can fetch EROFS native container images directly.
E.g. ctr run --snapshotter erofs -t quay.io/chengyuzhu6/ubuntu:20.04-erofs test /bin/bash

@ChengyuZhu6
Copy link
Copy Markdown
Member Author

cc @dmcgowan @hsiangkao

Comment thread core/images/mediatypes.go Outdated
Comment thread core/images/mediatypes.go Outdated
Copy link
Copy Markdown
Member

@hsiangkao hsiangkao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ChengyuZhu6
Copy link
Copy Markdown
Member Author

ping @dmcgowan

Copy link
Copy Markdown
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to wait for other maintainers to chime in

Comment thread core/images/mediatypes.go Outdated
Copy link
Copy Markdown
Member

@fuweid fuweid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread core/images/mediatypes.go Outdated
MediaTypeImageLayerGzipEncrypted = ocispec.MediaTypeImageLayerGzip + "+encrypted"

// EROFS media type.
// The ".erofs" suffix is kept for compatibility with containerd 2.1,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can update that erofs doc in that follow up.

@dmcgowan dmcgowan added this to the 2.3 milestone Dec 2, 2025
@hsiangkao
Copy link
Copy Markdown
Member

@ChengyuZhu6 , can you simply change the exact mediatype into vnd.erofs.layer.overlayfs.v1.erofs?
Does that look good then? Cc @dmcgowan @fuweid

Anyway, it's a prerequisite for #12506

@ChengyuZhu6
Copy link
Copy Markdown
Member Author

@ChengyuZhu6 , can you simply change the exact mediatype into vnd.erofs.layer.overlayfs.v1.erofs? Does that look good then? Cc @dmcgowan @fuweid

Anyway, it's a prerequisite for #12506

Done.

Comment thread core/images/mediatypes.go Outdated
// EROFS media type.
// The ".erofs" suffix is kept for compatibility with containerd 2.1,
// which detect native EROFS layers by checking whether the media type ends with ".erofs".
MediaTypeErofsLayer = "vnd.erofs.layer.overlayfs.v1.erofs"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you help me understand the reasoning behind two choices here?

  1. is there a reason this mediaType string starts at vnd instead of application/vnd like the others?
  2. what's the purpose of including overlayfs as part of the subtype? I've seen strings that use layer.v1 but didn't find any precedent for layer.{something}.v1 (other than nondistributable). My guess is it's to signal that erofs is an overlay filesystem, but it's not clear to me why its important to include that in the media type.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops, missed the discussion + this comment. so then my only Q is the first one about application/vnd

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm one more nit / thought-- might be overly verbose, but could be nice to link to the vnd.erofs media type definition inline here for reference

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@anniecherk
Copy link
Copy Markdown

This looks great; having this erofs layer media type defined seems like it'll be useful esp as adoption increases. Happy to rebase #12506 on top of this when it's ready to land

Copy link
Copy Markdown
Member

@cpuguy83 cpuguy83 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM, but definitely will defer to @dmcgowan here.

@github-project-automation github-project-automation Bot moved this from Needs Triage to Review In Progress in Pull Request Review Dec 17, 2025
@ChengyuZhu6 ChengyuZhu6 force-pushed the erofs-mediatype branch 2 times, most recently from a4a5d90 to 90d97cd Compare December 17, 2025 07:32
@ChengyuZhu6 ChengyuZhu6 force-pushed the erofs-mediatype branch 2 times, most recently from abc1009 to f8f0b00 Compare December 18, 2025 08:09
Comment thread plugins/diff/erofs/differ.go
@ChengyuZhu6 ChengyuZhu6 force-pushed the erofs-mediatype branch 2 times, most recently from 08c529d to e1cde6c Compare December 18, 2025 14:58
@ChengyuZhu6
Copy link
Copy Markdown
Member Author

@containerd/committers As for this PR, could you give some more comments or reviews?

Copy link
Copy Markdown
Member

@djdongjin djdongjin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread plugins/diff/erofs/differ.go
@dmcgowan dmcgowan added this pull request to the merge queue Jan 6, 2026
github-merge-queue Bot pushed a commit that referenced this pull request Jan 6, 2026
images: add EROFS layer media type
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jan 6, 2026
@dmcgowan dmcgowan added this pull request to the merge queue Jan 6, 2026
Merged via the queue into containerd:main with commit 415b5a5 Jan 6, 2026
91 of 92 checks passed
@github-project-automation github-project-automation Bot moved this from Review In Progress to Done in Pull Request Review Jan 6, 2026
@hsiangkao
Copy link
Copy Markdown
Member

hsiangkao commented Jan 6, 2026

Thanks Derek(@dmcgowan), Wei(@fuweid), Brian(@cpuguy83), Annie (@anniecherk), Aadhar (@aadhar-agarwal) and Chengyu (@ChengyuZhu6) , happy new year to all again! 🎉

@ChengyuZhu6 ChengyuZhu6 deleted the erofs-mediatype branch January 6, 2026 07:33
@hsiangkao hsiangkao mentioned this pull request Jan 9, 2026
10 tasks
@dmcgowan dmcgowan changed the title images: add EROFS layer media type Add EROFS layer media type Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

9 participants