Skip to content

Commit 84a74b0

Browse files
authored
Merge pull request #501 from vbatts/descriptor_annotations
Descriptor annotations
2 parents 2d7ee1a + f185dd5 commit 84a74b0

File tree

6 files changed

+37
-25
lines changed

6 files changed

+37
-25
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ DOC_FILES := \
2929
manifest-list.md \
3030
layer.md \
3131
config.md \
32+
annotations.md \
3233
canonicalization.md
3334

3435
FIGURE_FILES := \

annotations.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Annotations
2+
Several components of the specification, like [Image Manifests](manifest.md) and [Descriptors](descriptor.md), feature an optional annotations property, whose format is common and defined in this section.
3+
4+
This property contains arbitrary metadata.
5+
6+
## Rules
7+
8+
Annotations MUST be a key-value map where both the key and value MUST be strings.
9+
While the value MUST be present, it MAY be an empty string.
10+
Keys MUST be unique within this map, and best practice is to namespace the keys.
11+
Keys SHOULD be named using a reverse domain notation - e.g. `com.example.myKey`.
12+
Keys using the `org.opencontainers` namespace are reserved and MUST NOT be used by other specifications and extensions.
13+
If there are no annotations then this property MUST either be absent or be an empty map.
14+
Consumers MUST NOT generate an error if they encounter an unknown annotation key.
15+
16+
## Pre-Defined Annotation Keys
17+
18+
This specification defines the following annotation keys, intended for but not limited to manifest list and image manifest authors:
19+
* **org.opencontainers.created** date on which the image was built (string, date-time as defined by [RFC 3339](https://tools.ietf.org/html/rfc3339#section-5.6)).
20+
* **org.opencontainers.authors** contact details of the people or organization responsible for the image (freeform string)
21+
* **org.opencontainers.homepage** URL to find more information on the image (string, a URL with scheme HTTP or HTTPS)
22+
* **org.opencontainers.documentation** URL to get documentation on the image (string, a URL with scheme HTTP or HTTPS)
23+
* **org.opencontainers.source** URL to get source code for the binary files in the image (string, a URL with scheme HTTP or HTTPS)

descriptor.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ The following fields contain the primary properties that constitute a Descriptor
4040
Each entry MUST conform to [RFC 3986][rfc3986].
4141
Entries SHOULD use the `http` and `https` schemes, as defined in [RFC 7230][rfc7230-s2.7].
4242

43+
- **`annotations`** *string-string map*
44+
45+
This OPTIONAL property contains arbitrary metadata for this descriptor.
46+
This OPTIONAL property MUST use the [annotation rules](annotations.md#rules).
47+
4348
### Reserved
4449

4550
The following field keys are reserved and MUST NOT be used by other specifications.
@@ -118,9 +123,11 @@ The following example describes a [_Manifest_](manifest.md#image-manifest) with
118123
"size": 7682,
119124
"digest": "sha256:5b0bcabd1ed22e9fb1310cf6c2dec7cdef19f0ad69efa1f392e94a4333501270"
120125
}
126+
```
121127

122128
In the following example, the descriptor indicates that the referenced manifest is retrievable from a particular URL:
123129

130+
```json,title=Content%20Descriptor&mediatype=application/vnd.oci.descriptor.v1%2Bjson
124131
{
125132
"mediaType": "application/vnd.oci.image.manifest.v1+json",
126133
"size": 7682,

manifest-list.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,9 @@ For the media type(s) that this document is compatible with, see the [matrix][ma
6767
- **`annotations`** *string-string map*
6868

6969
This OPTIONAL property contains arbitrary metadata for the manifest list.
70-
Annotations MUST be a key-value map where both the key and value MUST be strings.
71-
While the value MUST be present, it MAY be an empty string.
72-
Keys MUST be unique within this map, and best practice is to namespace the keys.
73-
Keys SHOULD be named using a reverse domain notation - e.g. `com.example.myKey`.
74-
Keys using the `org.opencontainers` namespace are reserved and MUST NOT be used by other specifications.
75-
If there are no annotations then this property MUST either be absent or be an empty map.
76-
Implementations that are reading/processing manifest lists MUST NOT generate an error if they encounter an unknown annotation key.
77-
78-
See [Pre-Defined Annotation Keys](manifest.md#pre-defined-annotation-keys).
70+
This OPTIONAL property MUST use the [annotation rules](annotations.md#rules).
71+
72+
See [Pre-Defined Annotation Keys](annotations.md#pre-defined-annotation-keys).
7973

8074
### Extensibility
8175
Implementations that are reading/processing manifest lists MUST NOT generate an error if they encounter an unknown property.

manifest.md

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,9 @@ Unlike the [Manifest List](manifest-list.md), which contains information about a
6262
- **`annotations`** *string-string map*
6363

6464
This OPTIONAL property contains arbitrary metadata for the image manifest.
65-
Annotations MUST be a key-value map where both the key and value MUST be strings.
66-
While the value MUST be present, it MAY be an empty string.
67-
Keys MUST be unique within this map, and best practice is to namespace the keys.
68-
Keys SHOULD be named using a reverse domain notation - e.g. `com.example.myKey`.
69-
Keys using the `org.opencontainers` namespace are reserved and MUST NOT be used by other specifications.
70-
If there are no annotations then this property MUST either be absent or be an empty map.
71-
Implementations that are reading/processing the image manifest MUST NOT generate an error if they encounter an unknown annotation key.
65+
This OPTIONAL property MUST use the [annotation rules](annotations.md#rules).
7266

73-
See [Pre-Defined Annotation Keys](#pre-defined-annotation-keys).
67+
See [Pre-Defined Annotation Keys](annotations.md#pre-defined-annotation-keys).
7468

7569
### Extensibility
7670
Implementations that are reading/processing image manifests MUST NOT generate an error if they encounter an unknown property.
@@ -111,11 +105,3 @@ Instead they MUST ignore unknown properties.
111105
}
112106
}
113107
```
114-
115-
# Pre-Defined Annotation Keys
116-
This specification defines the following annotation keys, which MAY be used by manifest list and image manifest authors:
117-
* **org.opencontainers.created** date on which the image was built (string, date-time as defined by [RFC 3339](https://tools.ietf.org/html/rfc3339#section-5.6)).
118-
* **org.opencontainers.authors** contact details of the people or organization responsible for the image (freeform string)
119-
* **org.opencontainers.homepage** URL to find more information on the image (string, must be a URL with scheme HTTP or HTTPS)
120-
* **org.opencontainers.documentation** URL to get documentation on the image (string, must be a URL with scheme HTTP or HTTPS)
121-
* **org.opencontainers.source** URL to get source code for the binary files in the image (string, must be a URL with scheme HTTP or HTTPS)

spec.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ The goal of this specification is to enable the creation of interoperable tools
1717
- [Image Manifest List](manifest-list.md)
1818
- [Filesystem Layers](layer.md)
1919
- [Image Configuration](config.md)
20+
- [Annotations](annotations.md)
2021
- [Canonicalization](canonicalization.md)
2122

2223
# Notational Conventions

0 commit comments

Comments
 (0)