You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
media-types: Define layer media types with and without '+gzip'
I'd prefer defining this as a structured syntax suffix following RFC
6839, and have filed a pull request to that effect [1]. However, the
current maintainer consensus seems to be to define the compressed and
uncompressed types directly without declaring a structured syntax
suffix pattern [2]. I'm not clear on the reason for avoiding the
structured syntax suffix, but that's the route I've taken in this
commit.
Now that you can choose both compressed or uncompressed media types,
it is easy to clarify DiffIDs by comparing types with and without the
+gzip compression. media type. It also allows you to create
image-layout instances where the layers are stored uncompressed, which
may be useful for cases such as:
* Binary diffing between layer blobs for cheaper updates of large
layers [3].
* Compressing an image-layout tarball for a smaller smaller overall
tarball (by avoiding the unnecessary fragmentation of compressing
the individual blob entries).
Also update unpackLayer to handle both compressed and uncompressed
layers. I expect unpackLayer will end up in image-tools, so I haven't
invested a lot of time polishing this implementation. But without
*some* sort of change the manifest tests fail.
[1]: opencontainers#332
[2]: opencontainers#332 (comment)
[3]: http://ircbot.wl.linuxfoundation.org/eavesdrop/%23opencontainers/%23opencontainers.2016-08-16.log.html#t2016-08-16T23:35:43
Signed-off-by: W. Trevor King <[email protected]>
Copy file name to clipboardExpand all lines: config.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,8 @@ Changing it means creating a new derived image, instead of changing the existing
28
28
A layer DiffID is a SHA256 digest over the layer's uncompressed tar archive and serialized in the descriptor digest format, e.g., `sha256:a9561eb1b190625c9adb5a9513e72c4dedafc1cb2d4c5236c9a6957ec7dfd5a9`.
29
29
Layers must be packed and unpacked reproducibly to avoid changing the layer DiffID, for example by using tar-split to save the tar headers.
30
30
31
-
NOTE: the DiffID is different than the digest in the manifest list because the manifest digest is taken over the gzipped layer for `application/vnd.oci.image.layer.v1.tar+gzip` types.
31
+
The difference between DiffIDs and the layer digests in the [manifest's `layers`](manifest.md#image-manifest-property-descriptions) is that the layer digest is taken over the blob regardless of compression, while the DiffID is taken after removing any compression.
32
+
For an `application/vnd.oci.image.layer.tar+gzip` layer, the layer digest is taken over the `application/vnd.oci.image.layer.tar+gzip` content, while the DiffID is take over the `application/vnd.oci.image.layer.tar` content.
layer [shape=note, label="Layer tar archive\napplication/vnd.oci.image.layer.v1.tar\napplication/vnd.oci.image.layer.v1.tar+gzip\napplication/vnd.oci.image.layer.nondistributable.v1.tar\napplication/vnd.oci.image.layer.nondistributable.v1.tar+gzip"]
Copy file name to clipboardExpand all lines: layer.md
+5-6Lines changed: 5 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,12 @@ This document describes how to serialize a filesystem and filesystem changes lik
4
4
One or more layers are applied on top of each other to create a complete filesystem.
5
5
This document will use a concrete example to illustrate how to create and consume these filesystem layers.
6
6
7
-
This section defines the `application/vnd.oci.image.layer.v1.tar+gzip` and `application/vnd.oci.image.layer.nondistributable.v1.tar+gzip`[media types](media-types.md).
7
+
This section defines the `application/vnd.oci.image.layer.v1.tar` and `application/vnd.oci.image.layer.nondistributable.v1.tar`[media types](media-types.md).
8
8
9
9
## Distributable Format
10
10
11
-
Layer Changesets for the [mediatype](./media-types.md)`application/vnd.oci.image.layer.v1.tar+gzip` MUST be packaged in a [tar archive][tar-archive] compressed with [gzip][gzip].
12
-
Layer Changesets for the [mediatype](./media-types.md)`application/vnd.oci.image.layer.v1.tar+gzip` MUST NOT include duplicate entries for file paths in the resulting [tar archive][tar-archive].
11
+
Layer Changesets for the [media type](./media-types.md)`application/vnd.oci.image.layer.v1.tar` MUST be packaged in [tar archive][tar-archive].
12
+
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].
13
13
14
14
## Change Types
15
15
@@ -208,7 +208,7 @@ Where the basename name of `./etc/my-app-config` is now prefixed with `.wh.`, an
208
208
209
209
## Applying
210
210
211
-
Layer Changesets of [mediatype](./media-types.md)`application/vnd.oci.image.layer.v1.tar+gzip` are applied rather than strictly extracted in normal fashion for tar archives.
211
+
Layer Changesets of [media type](./media-types.md)`application/vnd.oci.image.layer.v1.tar` are applied rather than strictly extracted in normal fashion for tar archives.
212
212
213
213
Applying a layer changeset requires consideration for the [whiteout](#whiteouts) files.
214
214
In the absence of any [whiteout](#whiteouts) files in a layer changeset, the archive is extracted like a regular tar archive.
@@ -313,11 +313,10 @@ Any given image is likely to be composed of several of these Image Filesystem Ch
313
313
Certain layers, due to legal requirements, may not be regularly distributable.
314
314
Typically, such layers are downloaded directly from a distributor but are never uploaded.
315
315
316
-
Layers that have these restrictions SHOULD be tagged with an alternative mediatype of `application/vnd.oci.image.layer.nondistributable.v1.tar+gzip`.
316
+
Layers that have these restrictions SHOULD be tagged with an alternative media type of `application/vnd.oci.image.layer.nondistributable.v1.tar`.
317
317
[Descriptors](descriptor.md) referencing these layers MAY include `urls` for downloading these layers.
318
318
It is implementation-defined whether or not implementations upload layers tagged with this media type.
-`application/vnd.oci.image.layer.v1.tar+gzip`: ["Layer", as a gzipped tar archive](layer.md)
10
-
-`application/vnd.oci.image.layer.nondistributable.v1.tar+gzip`: ["Layer", as a gzipped tar archive with distribution restrictions](layer.md#non-distributable-layers)
9
+
-`application/vnd.oci.image.layer.v1.tar`: ["Layer", as a tar archive](layer.md)
10
+
-`application/vnd.oci.image.layer.v1.tar+gzip`: ["Layer", as a tar archive](layer.md) compressed with [gzip][rfc1952]
11
+
-`application/vnd.oci.image.layer.nondistributable.v1.tar`: ["Layer", as a tar archive with distribution restrictions](layer.md#non-distributable-layers)
12
+
-`application/vnd.oci.image.layer.nondistributable.v1.tar+gzip`: ["Layer", as a tar archive with distribution restrictions](layer.md#non-distributable-layers) compressed with [gzip][rfc1952]
11
13
12
14
## Compatibility Matrix
13
15
@@ -27,7 +29,7 @@ This section shows where the OCI Image Specification is compatible with formats
**Interchangeable and fully compatible mime-types**
33
35
@@ -47,3 +49,7 @@ The following figure shows how the above media types reference each other:
47
49
48
50
[Descriptors](descriptor.md) are used for all references.
49
51
The manifest list being a "fat manifest" references one or more image manifests per target platform. An image manifest references exactly one target configuration and possibly many layers.
0 commit comments