Skip to content

Commit 477254c

Browse files
committed
Add support for erofs and squashfs layer media types
OCI artifacts support has landed in various OCI specs v1.1.0 which allows for arbitrary artifact types, small and large. Large artifacts (even existing container images) pose a particular challenge that: 1) it takes too long to download 2) it takes too long to unpack This PR **begins** to address 2) above. OCI image layers have traditionally been packaged as tar archives which must be unpacked after downloading. Read-only compressed filesystems such as squashfs and erofs present viable alternatives such that the unpack step can be skipped since they are directly mountable and overlayfs compatible. squashfs is older but has wider platform support (Linux, *BSD and Windows). erofs is newer and has strong community support but very Linux-specific. Build tools will now produce these new layers directly instead of tar archives. Additional reading: https://www.cyphar.com/blog/post/20190121-ociv2-images-i-tar https://groups.google.com/a/opencontainers.org/g/dev/c/Zk3yf45HIdA?pli=1 Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
1 parent b329711 commit 477254c

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

layer.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ This section defines the `application/vnd.oci.image.layer.v1.tar`, `application/
2020

2121
- Layer Changesets for the [media type](media-types.md) `application/vnd.oci.image.layer.v1.tar` MUST be packaged in [tar archive][tar-archive].
2222
- Layer Changesets for the [media type](media-types.md) `application/vnd.oci.image.layer.v1.tar` MUST NOT include duplicate entries for file paths in the resulting [tar archive][tar-archive].
23+
- Layer Changesets for the [media type](media-types.md) `application/vnd.oci.image.layer.v1.squashfs` MUST be packaged in [squashfs file][squashfs].
24+
- Layer Changesets for the [media type](media-types.md) `application/vnd.oci.image.layer.v1.tar` MUST be packaged in [erofs file][erofs].
2325

2426
## Change Types
2527

@@ -342,3 +344,5 @@ Implementations SHOULD NOT upload layers tagged with this media type; however, s
342344
[rfc1952_2]: https://tools.ietf.org/html/rfc1952
343345
[tar-archive]: https://en.wikipedia.org/wiki/Tar_(computing)
344346
[rfc8478]: https://tools.ietf.org/html/rfc8478
347+
[squashfs]: https://github.com/plougher/squashfs-tools
348+
[erofs]: https://erofs.docs.kernel.org/

specs-go/v1/mediatype.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ const (
4545
// MediaTypeImageLayerZstd is the media type used for zstd compressed
4646
// layers referenced by the manifest.
4747
MediaTypeImageLayerZstd = "application/vnd.oci.image.layer.v1.tar+zstd"
48+
49+
// MediaTypeSquashfs specifies the media type as squashfs filesystem layer
50+
// https://github.com/plougher/squashfs-tools
51+
MediaTypeSquashfs = "application/vnd.oci.image.layer.v1.squashfs"
52+
53+
// MediaTypeErofs specifies the media type as erofs filesystem layer
54+
// https://www.iana.org/assignments/media-types/application/vnd.erofs
55+
MediaTypeErofs = "application/vnd.oci.image.layer.v1.erofs"
4856
)
4957

5058
// Non-distributable layer media-types.

0 commit comments

Comments
 (0)