Skip to content

Commit 021bb35

Browse files
committed
config: adding labels
the "Labels" field is not specified in the docker image spec, but is present and used. https://github.com/docker/docker/blob/master/image/spec/v1.2.md This carries over that functionality Signed-off-by: Vincent Batts <[email protected]>
1 parent 41f1d08 commit 021bb35

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

config.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,16 @@ Since the [configuration JSON](#image-json) that gets hashed references hashes o
133133
Sets the current working directory of the entrypoint process in the container.
134134
This value acts as a default and is replaced by a working directory specified when creating a container.
135135

136+
- **Labels ** *object*, OPTIONAL
137+
138+
The field contains arbitrary metadata for the container.
139+
Labels MUST be a key-value map where both the key and value MUST be strings.
140+
Keys MUST be unique within this map, and best practice is to namespace the keys.
141+
Keys SHOULD be named using a reverse domain notation - e.g. `com.example.myKey`.
142+
Keys using the `org.opencontainers` namespace are reserved and MUST NOT be used by subsequent specifications.
143+
If there are no annotations then this property MAY either be absent or an empty map.
144+
Implementations that are reading/processing this configuration file MUST NOT generate an error if they encounter an unknown annotation key.
145+
136146
- **rootfs** *object*, REQUIRED
137147

138148
The rootfs key references the layer content addresses used by the image.
@@ -213,7 +223,11 @@ Here is an example image configuration JSON document:
213223
"/var/job-result-data": {},
214224
"/var/log/my-app-logs": {}
215225
},
216-
"WorkingDir": "/home/alice"
226+
"WorkingDir": "/home/alice",
227+
"Labels": {
228+
"com.example.project.git.url": "https://example.com/project.git",
229+
"com.example.project.git.commit": "45a939b2999782a3f005621a8d0f29aa387e1d6b"
230+
}
217231
},
218232
"rootfs": {
219233
"diff_ids": [

0 commit comments

Comments
 (0)