Skip to content

Commit

Permalink
manifest: add annotations
Browse files Browse the repository at this point in the history
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 <vbatts@hashbangbash.com>
  • Loading branch information
vbatts committed Apr 27, 2016
1 parent 5108f13 commit 430b936
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 2 deletions.
25 changes: 23 additions & 2 deletions manifest.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ A client will distinguish a manifest list from an image manifest based on the Co

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

- **`annotations`** *hashmap*

This OPTIONAL property contains arbitrary metadata for the manifest list.
This information may be structured or unstructured.
Annotations are key-value maps.

## Example Manifest List

*Example showing a simple manifest list pointing to image manifests for two platforms:*
Expand Down Expand Up @@ -118,7 +124,11 @@ A client will distinguish a manifest list from an image manifest based on the Co
]
}
}
]
],
"annotations": {
"key1": "value1",
"key2": "value2",
}
}
```

Expand Down Expand Up @@ -182,6 +192,13 @@ The image manifest provides a configuration and a set of layers for a container

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

- **`annotations`** *hashmap*

This OPTIONAL property contains arbitrary metadata for the manifest.
This information may be structured or unstructured.
Annotations are key-value maps.


## Example Image Manifest

*Example showing an image manifest:*
Expand Down Expand Up @@ -210,7 +227,11 @@ The image manifest provides a configuration and a set of layers for a container
"size": 73109,
"digest": "sha256:ec4b8955958665577945c89419d1af06b5f7636b4ac3da7f12184802ad867736"
}
]
],
"annotations": {
"key1": "value1",
"key2": "value2",
}
}
```

Expand Down
11 changes: 11 additions & 0 deletions schema/defs-image.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,17 @@
}
}
}
},
"annotations": {
"id": "https://opencontainers.org/schema/image/annotations",
"oneOf": [
{
"$ref": "defs.json#/definitions/mapStringString"
},
{
"type": "null"
}
]
}
}
}
4 changes: 4 additions & 0 deletions schema/image-manifest-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
"items": {
"$ref": "defs-image.json#/definitions/descriptor"
}
},
"annotations": {
"id": "https://opencontainers.org/schema/image/manifest-list/annotations",
"$ref": "defs-image.json#/definitions/annotations"
}
},
"required": [
Expand Down
4 changes: 4 additions & 0 deletions schema/manifest-list-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
"items": {
"$ref": "defs-image.json#/definitions/manifestDescriptor"
}
},
"annotations": {
"id": "https://opencontainers.org/schema/image/manifest-list/annotations",
"$ref": "defs-image.json#/definitions/annotations"
}
},
"required": [
Expand Down

0 comments on commit 430b936

Please sign in to comment.