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
Copy file name to clipboardExpand all lines: manifest.md
+37-36Lines changed: 37 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ Unlike the [image index](image-index.md), which contains information about a set
29
29
-**`artifactType`***string*
30
30
31
31
This OPTIONAL property contains the type of an artifact when the manifest is used for an artifact.
32
-
This MUST be set when `config.mediaType` is set to the [scratch value](#example-of-a-scratch-config-or-layer-descriptor).
32
+
This MUST be set when `config.mediaType` is set to the [empty value](#guidance-for-an-empty-descriptor).
33
33
If defined, the value MUST comply with [RFC 6838][rfc6838], including the [naming requirements in its section 4.2][rfc6838-s4.2], and MAY be registered with [IANA][iana].
34
34
35
35
-**`config`***[descriptor](descriptor.md)*
@@ -49,16 +49,13 @@ Unlike the [image index](image-index.md), which contains information about a set
49
49
50
50
If the manifest uses a different media type than the above, it MUST comply with [RFC 6838][rfc6838], including the [naming requirements in its section 4.2][rfc6838-s4.2], and MAY be registered with [IANA][iana].
51
51
52
-
To set an effectively NULL or SCRATCH config and maintain portability the following is considered GUIDANCE.
53
-
While an empty blob (`size` of 0) may be preferable, practice has shown that not to be ubiquitiously supported.
54
-
Instead, the blob payload can be the most minimal content that is still valid JSON object: `{}` (`size` of 2).
55
-
The blob digest of `{}` is `sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a`.
56
-
See the [example SCRATCH config](#example-of-a-scratch-config-or-layer-descriptor) below, and `ScratchDescriptor` of the reference code.
52
+
To set an effectively null or empty config and maintain portability see the [guidance for an empty descriptor](#guidance-for-an-empty-descriptor) below, and `DescriptorEmptyJSON` of the reference code.
57
53
58
54
-**`layers`***array of objects*
59
55
60
56
Each item in the array MUST be a [descriptor](descriptor.md).
61
57
For portability, `layers` SHOULD have at least one entry.
58
+
See the [guidance for an empty descriptor](#guidance-for-an-empty-descriptor) below, and `DescriptorEmptyJSON` of the reference code.
62
59
63
60
When the `config.mediaType` is set to `application/vnd.oci.image.config.v1+json`, the following additional restrictions apply:
64
61
@@ -67,9 +64,6 @@ Unlike the [image index](image-index.md), which contains information about a set
67
64
- The final filesystem layout MUST match the result of [applying](layer.md#applying-changesets) the layers to an empty directory.
68
65
- The [ownership, mode, and other attributes](layer.md#file-attributes) of the initial empty directory are unspecified.
69
66
70
-
For broad portability, if a layer is required to be used, use the SCRATCH layer.
71
-
See the [example SCRATCH layer](#example-of-a-scratch-config-or-layer-descriptor) below, and `ScratchDescriptor` of the reference code.
72
-
73
67
Beyond the [descriptor requirements](descriptor.md#properties), the value has the following additional restrictions:
74
68
75
69
-**`mediaType`***string*
@@ -89,7 +83,7 @@ Unlike the [image index](image-index.md), which contains information about a set
89
83
90
84
If the manifest uses a different media type than the above, it MUST comply with [RFC 6838][rfc6838], including the [naming requirements in its section 4.2][rfc6838-s4.2], and MAY be registered with [IANA][iana].
91
85
92
-
See [Guidelines for Artifact Usage](#guidelines-for-artifact-usage) for other uses of the `layers`.
86
+
See [Guidelines for Artifact Usage](#guidelines-for-artifact-usage) for other uses of the `layers`.
93
87
94
88
-**`subject`***[descriptor](descriptor.md)*
95
89
@@ -112,30 +106,30 @@ Unlike the [image index](image-index.md), which contains information about a set
@@ -144,28 +138,35 @@ Unlike the [image index](image-index.md), which contains information about a set
144
138
}
145
139
```
146
140
147
-
## Example of a SCRATCH config or layer descriptor
141
+
## Guidance for an Empty Descriptor
142
+
143
+
*Implementers note*: The following is considered GUIDANCE for portability.
148
144
149
-
Notice that the `mediaType` is subject to the usage or context, while the digest is specifically defined as `ScratchDigestSHA256`.
150
-
When the `ScratchDigestSHA256` is used, the media type SHOULD be set to `application/vnd.oci.scratch.v1+json` to differentiate the descriptor from one pointing to content.
145
+
Parts of the spec necessitate including a descriptor to a blob where some implementations of artifacts do not have associated content.
146
+
While an empty blob (`size` of 0) may be preferable, practice has shown that not to be ubiquitously supported.
147
+
The media type `application/vnd.oci.empty.v1+json` (`MediaTypeEmptyJSON`) has been specified for a descriptor that has no content for the implementation.
148
+
The blob payload is the most minimal content that is still a valid JSON object: `{}` (`size` of 2).
149
+
The blob digest of `{}` is `sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a`.
150
+
The data field is optional, and if included is the base64 encoding of `{}`: `e30=`.
The content of the scratch blob is `{}` (`size` of 2).
161
-
162
163
## Guidelines for Artifact Usage
163
164
164
165
Content other than OCI container images MAY be packaged using the image manifest.
165
-
When this is done, the `config.mediaType` value MUST be set to a value specific to the artifact type or the [scratch value](#example-of-a-scratch-config-or-layer-descriptor).
166
-
If the `config.mediaType` is set to the scratch value, the `artifactType` MUST be defined.
166
+
When this is done, the `config.mediaType` value MUST be set to a value specific to the artifact type or the [empty value](#guidance-for-an-empty-descriptor).
167
+
If the `config.mediaType` is set to the empty value, the `artifactType` MUST be defined.
167
168
If the artifact does not need layers, a single layer SHOULD be included with a non-zero size.
168
-
The suggested content for an unused layer is the [SCRATCH](#example-of-a-scratch-config-or-layer-descriptor) descriptor.
169
+
The suggested content for an unused `layers` array is the [empty descriptor](#guidance-for-an-empty-descriptor).
169
170
170
171
Here is an example manifest for a typical artifact:
171
172
@@ -188,15 +189,15 @@ Here is an example manifest for a typical artifact:
188
189
}
189
190
```
190
191
191
-
Here is an example manifest for a simple artifact without content in the config, using the scratch descriptor:
192
+
Here is an example manifest for a simple artifact without content in the config, using the empty descriptor:
-`application/vnd.oci.empty.v1+json`: [Empty for unused descriptors](manifest.md#guidance-for-an-empty-descriptor)
14
14
15
15
The following media types identify a ["Layer" with distribution restrictions](layer.md#non-distributable-layers), but are **deprecated** and not recommended for future use:
0 commit comments