Skip to content

Commit 629abd5

Browse files
author
Brandon Philips
committed
config: address feedback from wking and
- use correct indentation for sub lists - address some missing OPTIONAL tags - random formatting issues. Thanks @coolljt0725 and @wking for the review.
1 parent 403a1af commit 629abd5

File tree

1 file changed

+37
-36
lines changed

1 file changed

+37
-36
lines changed

config.md

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Changing it means creating a new derived image, instead of changing the existing
2626
A layer DiffID is a SHA256 digest over the layer's uncompressed tar archive and serialized in the descriptor digest format, e.g., `sha256:a9561eb1b190625c9adb5a9513e72c4dedafc1cb2d4c5236c9a6957ec7dfd5a9`.
2727
Layers must be packed and unpacked reproducibly to avoid changing the layer DiffID, for example by using tar-split to save the tar headers.
2828

29-
NOTE: the DiffID is different than the digest in the manifest list because the manifest digest is taken over the gzipped layer for <code>application/vnd.oci.image.layer.tar+gzip</code> types.
29+
NOTE: the DiffID is different than the digest in the manifest list because the manifest digest is taken over the gzipped layer for `application/vnd.oci.image.layer.tar+gzip` types.
3030

3131
### Layer ChainID
3232

@@ -35,20 +35,20 @@ This is called a `ChainID`.
3535
For a single layer (or the layer at the bottom of a stack), the
3636
`ChainID` is equal to the layer's `DiffID`.
3737

38-
Otherwise the <code>ChainID</code> is given by the formula:
39-
<code>ChainID(layerN) = SHA256hex(ChainID(layerN-1) + " " + DiffID(layerN))</code>.
38+
Otherwise the `ChainID` is given by the formula:
39+
`ChainID(layerN) = SHA256hex(ChainID(layerN-1) + " " + DiffID(layerN))`.
4040

4141
### ImageID
4242

4343
Each image's ID is given by the SHA256 hash of its configuration JSON.
44-
It is represented as a hexadecimal encoding of 256 bits, e.g., <code>sha256:a9561eb1b190625c9adb5a9513e72c4dedafc1cb2d4c5236c9a6957ec7dfd5a9</code>.
44+
It is represented as a hexadecimal encoding of 256 bits, e.g., `sha256:a9561eb1b190625c9adb5a9513e72c4dedafc1cb2d4c5236c9a6957ec7dfd5a9`.
4545
Since the configuration JSON that gets hashed references hashes of each layer in the image, this formulation of the ImageID makes images content-addresable.
4646

4747
## Properties
4848

4949
- **created** *string*, OPTIONAL
5050

51-
A ISO-8601 formatted combined date and time at which the image was created.
51+
An ISO-8601 formatted combined date and time at which the image was created.
5252

5353
- **author** *string*, OPTIONAL
5454

@@ -71,13 +71,13 @@ Since the configuration JSON that gets hashed references hashes of each layer in
7171
- **config** *object*, OPTIONAL
7272

7373
The execution parameters which should be used as a base when running a container using the image.
74-
This field can be <code>null</code>, in which case any execution parameters should be specified at creation of the container.
74+
This field can be `null`, in which case any execution parameters should be specified at creation of the container.
7575

76-
- **user** *string*, OPTIONAL
76+
- **User** *string*, OPTIONAL
7777

7878
The username or UID which the process in the container should run as.
7979
This acts as a default value to use when the value is not specified when creating a container.
80-
All of the following are valid: `user`, `uid`, `user:group`, `uid:gid`, `uid:group`, `uiser:gid`
80+
All of the following are valid: `user`, `uid`, `user:group`, `uid:gid`, `uid:group`, `user:gid`
8181
If `group`/`gid` is not specified, the default group and supplementary groups of the given `user`/`uid` in `/etc/passwd` from the container are applied.
8282

8383
- **Memory** *integer*, OPTIONAL
@@ -87,7 +87,7 @@ Since the configuration JSON that gets hashed references hashes of each layer in
8787

8888
- **MemorySwap** *integer*, OPTIONAL
8989

90-
Total memory usage (memory + swap); set to <code>-1</code> to disable swap.
90+
Total memory usage (memory + swap); set to `-1` to disable swap.
9191
This acts as a default value to use when the value is not specified when creating a container.
9292

9393
- **CpuShares** *integer*, OPTIONAL
@@ -101,17 +101,17 @@ Since the configuration JSON that gets hashed references hashes of each layer in
101101
Its keys can be in the format of:
102102
`port/tcp`, `port/udp`, `port` with the default protocol being `tcp` if not specified.
103103
These values act as defaults and are merged with any specified when creating a container.
104-
**NOTE:** This JSON structure value is unusual because it is a direct JSON serialization of the Go type <code>map[string]struct{}</code> and is represented in JSON as an object mapping its keys to an empty object.
104+
**NOTE:** This JSON structure value is unusual because it is a direct JSON serialization of the Go type `map[string]struct{}` and is represented in JSON as an object mapping its keys to an empty object.
105105

106106
- **Env** *array of strings*, OPTIONAL
107107

108-
Entries are in the format of <code>VARNAME="var value"</code>.
108+
Entries are in the format of `VARNAME="var value"`.
109109
These values act as defaults and are merged with any specified when creating a container.
110110

111-
- **Entrypoint** *array of strings*
111+
- **Entrypoint** *array of strings*, OPTIONAL
112112

113113
A list of arguments to use as the command to execute when the container starts.
114-
This value acts as a default and is replaced by an entrypoint specified when creating a container. This field MAY be "null".
114+
This value acts as a default and is replaced by an entrypoint specified when creating a container. This field MAY be null.
115115

116116
- **Cmd** *array of strings*, OPTIONAL
117117

@@ -120,10 +120,11 @@ Since the configuration JSON that gets hashed references hashes of each layer in
120120
If an `Entrypoint` value is not specified, then the first entry of the `Cmd` array should be interpreted as the executable to run.
121121

122122
- **Volumes** *object*, OPTIONAL
123-
A set of directories which should be created as data volumes in a container running this image. This field MAY be "null".
124-
If a file or folder exists within the image with the same path as a data volume, that file or folder is replaced with the data volume and is never merged. **NOTE:** This JSON structure value is unusual because it is a direct JSON serialization of the Go type <code>map[string]struct{}</code> and is represented in JSON as an object mapping its keys to an empty object.
125123

126-
- **WorkingDir** *string*, REQUIRED
124+
A set of directories which should be created as data volumes in a container running this image. This field MAY be null.
125+
If a file or folder exists within the image with the same path as a data volume, that file or folder is replaced with the data volume and is never merged. **NOTE:** This JSON structure value is unusual because it is a direct JSON serialization of the Go type `map[string]struct{}` and is represented in JSON as an object mapping its keys to an empty object.
126+
127+
- **WorkingDir** *string*, OPTIONAL
127128

128129
Sets the current working directory of the entrypoint process in the container.
129130
This value acts as a default and is replaced by a working directory specified when creating a container.
@@ -133,41 +134,41 @@ Since the configuration JSON that gets hashed references hashes of each layer in
133134
The rootfs key references the layer content addresses used by the image.
134135
This makes the image config hash depend on the filesystem hash.
135136

136-
- **type** *string*, REQUIRED
137+
- **type** *string*, REQUIRED
137138

138-
MUST be set to `layers`.
139-
Implementations MUST generate an error if they encounter a unknown value while verifying or unpacking an image.
139+
MUST be set to `layers`.
140+
Implementations MUST generate an error if they encounter a unknown value while verifying or unpacking an image.
140141

141-
- **diff_ids** *array*, REQUIRED
142+
- **diff_ids** *array*, REQUIRED
142143

143-
An array of layer content hashes (`DiffIDs`), in order from bottom-most to top-most.
144+
An array of layer content hashes (`DiffIDs`), in order from bottom-most to top-most.
144145

145-
- **history** *array of object*
146+
- **history** *array of object*, REQUIRED
146147

147-
Describes the history of each layer.
148-
The array is ordered from bottom-most layer to top-most layer.
149-
The object has the following fields:
148+
Describes the history of each layer.
149+
The array is ordered from bottom-most layer to top-most layer.
150+
The object has the following fields:
150151

151-
- **created** *string*, OPTIONAL
152+
- **created** *string*, OPTIONAL
152153

153-
Creation time, expressed as a ISO-8601 formatted combined date and time
154+
Creation time, expressed as a ISO-8601 formatted combined date and time
154155

155-
- **author** *string*, OPTIONAL
156+
- **author** *string*, OPTIONAL
156157

157-
The author of the build point.
158+
The author of the build point.
158159

159-
- **created_by** *string*, OPTIONAL
160+
- **created_by** *string*, OPTIONAL
160161

161-
The command which created the layer.
162+
The command which created the layer.
162163

163-
- **comment** *string*, OPTIONAL
164+
- **comment** *string*, OPTIONAL
164165

165-
A custom message set when creating the layer.
166+
A custom message set when creating the layer.
166167

167-
- **empty_layer** *string*
168+
- **empty_layer** *boolean*, OPTIONAL
168169

169-
This field is used to mark if the history item created a filesystem diff, OPTIONAL
170-
It is set to true if this history item doesn't correspond to an actual layer in the rootfs section (for example, a command like ENV which results in no change to the filesystem).
170+
This field is used to mark if the history item created a filesystem diff, OPTIONAL
171+
It is set to true if this history item doesn't correspond to an actual layer in the rootfs section (for example, a command like ENV which results in no change to the filesystem).
171172

172173
Any extra fields in the Image JSON struct are considered implementation specific and should be ignored by any implementations which are unable to interpret them.
173174

0 commit comments

Comments
 (0)