Skip to content

Commit d15a9bc

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 <[email protected]>
1 parent c05acf7 commit d15a9bc

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

config.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ Layers SHOULD be packed and unpacked reproducibly to avoid changing the layer Di
3030

3131
NOTE: Do not confuse DiffIDs with [layer digests](manifest.md#image-manifest-property-descriptions), often referenced in the manifest, which are digests over compressed or uncompressed content.
3232

33+
For squashfs and erofs layers, a layer DiffID is the digest over the layer itself.
34+
3335
### Layer ChainID
3436

3537
For convenience, it is sometimes useful to refer to a stack of layers with a single identifier.

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.erofs` MUST be packaged in [erofs file][erofs].
2325

2426
## Change Types
2527

@@ -365,3 +367,5 @@ Implementations SHOULD NOT upload layers tagged with this media type; however, s
365367
[rfc1952_2]: https://tools.ietf.org/html/rfc1952
366368
[tar-archive]: https://en.wikipedia.org/wiki/Tar_(computing)
367369
[rfc8478]: https://tools.ietf.org/html/rfc8478
370+
[squashfs]: https://github.com/plougher/squashfs-tools
371+
[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)