Skip to content

Commit f15a268

Browse files
committed
annotations: make a designated doc and DRY a bit
In DRY'ing up the references to annotations. This makes the defined keys in a very logical place rather than the bottom of one of the other docs. Signed-off-by: Vincent Batts <[email protected]>
1 parent 4986a7e commit f15a268

File tree

3 files changed

+28
-25
lines changed

3 files changed

+28
-25
lines changed

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)

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)

0 commit comments

Comments
 (0)