Skip to content

Commit 78c7ff7

Browse files
committed
manifest: add annotations
This introduces OPTIONAL annotations, which are consistent with the annotations in the runtime-spec. While the spec does not exclude use of arbitrary fields, this OPTIONAL property gives a guided place for manifest authors to isolate their arbitrary metadata. Signed-off-by: Vincent Batts <[email protected]>
1 parent 1e0dbb8 commit 78c7ff7

File tree

4 files changed

+53
-2
lines changed

4 files changed

+53
-2
lines changed

manifest.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,18 @@ A client will distinguish a manifest list from an image manifest based on the Co
8181

8282
This OPTIONAL property specifies an array of strings, each specifying a mandatory CPU feature (for example `sse4` or `aes`).
8383

84+
- **`annotations`** *string-string hashmap*
85+
86+
This OPTIONAL property contains arbitrary metadata for the manifest list.
87+
Annotations is a key-value, unordered hashmap.
88+
Keys are unique, and best practice is to namespace the keys.
89+
Common annotation keys include:
90+
* **created** date on which the image was built (string, timestamps type)
91+
* **authors** contact details of the people or organization responsible for the image (freeform string)
92+
* **homepage** URL to find more information on the image (string, must be a URL with scheme HTTP or HTTPS)
93+
* **documentation** URL to get documentation on the image (string, must be a URL with scheme HTTP or HTTPS)
94+
95+
8496
## Example Manifest List
8597

8698
*Example showing a simple manifest list pointing to image manifests for two platforms:*
@@ -110,7 +122,11 @@ A client will distinguish a manifest list from an image manifest based on the Co
110122
]
111123
}
112124
}
113-
]
125+
],
126+
"annotations": {
127+
"key1": "value1",
128+
"key2": "value2",
129+
}
114130
}
115131
```
116132

@@ -174,6 +190,18 @@ The image manifest provides a configuration and a set of layers for a container
174190

175191
The digest of the content, as defined by the [Registry V2 HTTP API Specificiation](https://docs.docker.com/registry/spec/api/#digest-parameter).
176192

193+
- **`annotations`** *hashmap*
194+
195+
This OPTIONAL property contains arbitrary metadata for the manifest list.
196+
Annotations is a key-value, unordered hashmap.
197+
Keys are unique, and best practice is to namespace the keys.
198+
Common annotation keys include:
199+
* **created** date on which the image was built (string, timestamps type)
200+
* **authors** contact details of the people or organization responsible for the image (freeform string)
201+
* **homepage** URL to find more information on the image (string, must be a URL with scheme HTTP or HTTPS)
202+
* **documentation** URL to get documentation on the image (string, must be a URL with scheme HTTP or HTTPS)
203+
204+
177205
## Example Image Manifest
178206

179207
*Example showing an image manifest:*
@@ -202,7 +230,11 @@ The image manifest provides a configuration and a set of layers for a container
202230
"size": 73109,
203231
"digest": "sha256:ec4b8955958665577945c89419d1af06b5f7636b4ac3da7f12184802ad867736"
204232
}
205-
]
233+
],
234+
"annotations": {
235+
"key1": "value1",
236+
"key2": "value2",
237+
}
206238
}
207239
```
208240

schema/defs-image.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,17 @@
9494
}
9595
}
9696
}
97+
},
98+
"annotations": {
99+
"id": "https://opencontainers.org/schema/image/annotations",
100+
"oneOf": [
101+
{
102+
"$ref": "defs.json#/definitions/mapStringString"
103+
},
104+
{
105+
"type": "null"
106+
}
107+
]
97108
}
98109
}
99110
}

schema/image-manifest-schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
"items": {
2222
"$ref": "defs-image.json#/definitions/descriptor"
2323
}
24+
},
25+
"annotations": {
26+
"id": "https://opencontainers.org/schema/image/manifest-list/annotations",
27+
"$ref": "defs-image.json#/definitions/annotations"
2428
}
2529
},
2630
"required": [

schema/manifest-list-schema.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
"items": {
1919
"$ref": "defs-image.json#/definitions/manifestDescriptor"
2020
}
21+
},
22+
"annotations": {
23+
"id": "https://opencontainers.org/schema/image/manifest-list/annotations",
24+
"$ref": "defs-image.json#/definitions/annotations"
2125
}
2226
},
2327
"required": [

0 commit comments

Comments
 (0)