Skip to content

Commit 718f9f3

Browse files
author
Jesse Butler
committed
minor narrative cleanup regarding config compatibility
Signed-off-by: Jesse Butler <jesse.butler@oracle.com>
1 parent 0d104bb commit 718f9f3

File tree

1 file changed

+61
-59
lines changed

1 file changed

+61
-59
lines changed

config.md

Lines changed: 61 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22

33
The container's top-level directory MUST contain a configuration file called `config.json`.
44
The canonical schema is defined in this document, but there is a JSON Schema in [`schema/config-schema.json`](schema/config-schema.json) and Go bindings in [`specs-go/config.go`](specs-go/config.go).
5+
Platform-specific configuration schema are defined in the [platform-specific documents](#platform-specific-configuration) linked below.
56

67
The configuration file contains metadata necessary to implement standard operations against the container.
78
This includes the process to run, environment variables to inject, sandboxing features to use, etc.
89

9-
Below is a detailed description of each field defined in the configuration format.
10+
Below is a detailed description of each field defined in the configuration format and valid values are specified.
11+
Platform-specific fields are identified as such.
12+
For all platform-specific configuration values, the scope defined below in the [Platform-specific configuration](#platform-specific-configuration) section applies.
13+
1014

1115
## Specification version
1216

@@ -22,11 +26,11 @@ For example, if a configuration is compliant with version 1.1 of this specificat
2226

2327
## Root Configuration
2428

25-
**`root`** (object, REQUIRED) configures the container's root filesystem.
29+
**`root`** (object, REQUIRED) specifies the container's root filesystem.
2630

2731
* **`path`** (string, REQUIRED) Specifies the path to the root filesystem for the container.
28-
The path can be an absolute path (starting with /) or a relative path (not starting with /), which is relative to the bundle.
29-
For example (Linux), with a bundle at `/to/bundle` and a root filesystem at `/to/bundle/rootfs`, the `path` value can be either `/to/bundle/rootfs` or `rootfs`.
32+
The path is either an absolute path or a relative path to the bundle.
33+
On Linux, for example, with a bundle at `/to/bundle` and a root filesystem at `/to/bundle/rootfs`, the `path` value can be either `/to/bundle/rootfs` or `rootfs`.
3034
A directory MUST exist at the path declared by the field.
3135
* **`readonly`** (bool, OPTIONAL) If true then the root filesystem MUST be read-only inside the container, defaults to false.
3236

@@ -41,25 +45,27 @@ For example, if a configuration is compliant with version 1.1 of this specificat
4145

4246
## Mounts
4347

44-
**`mounts`** (array, OPTIONAL) configures additional mounts (on top of [`root`](#root-configuration)).
48+
**`mounts`** (array, OPTIONAL) specifies additional mounts beyond [`root`](#root-configuration).
4549
The runtime MUST mount entries in the listed order.
46-
The parameters are similar to the ones in [the Linux mount system call](http://man7.org/linux/man-pages/man2/mount.2.html).
47-
For Solaris, the mounts corresponds to fs resource in zonecfg(8).
50+
For Linux, the parameters are as documented in [the mount system call](http://man7.org/linux/man-pages/man2/mount.2.html).
51+
For Solaris, the mount entry corresponds to the 'fs' resource in zonecfg(8).
52+
For Windows, see links for details about [mountvol](http://ss64.com/nt/mountvol.html) and [SetVolumeMountPoint](https://msdn.microsoft.com/en-us/library/windows/desktop/aa365561(v=vs.85).aspx).
53+
4854

4955
* **`destination`** (string, REQUIRED) Destination of mount point: path inside container.
5056
This value MUST be an absolute path.
51-
For the Windows operating system, one mount destination MUST NOT be nested within another mount (e.g., c:\\foo and c:\\foo\\bar).
52-
For the Solaris operating system, this corresponds to "dir" of the fs resource in zonecfg(8).
57+
* Windows: one mount destination MUST NOT be nested within another mount (e.g., c:\\foo and c:\\foo\\bar).
58+
* Solaris: corresponds to "dir" of the fs resource in zonecfg(8).
5359
* **`type`** (string, REQUIRED) The filesystem type of the filesystem to be mounted.
54-
Linux: *filesystemtype* argument supported by the kernel are listed in */proc/filesystems* (e.g., "minix", "ext2", "ext3", "jfs", "xfs", "reiserfs", "msdos", "proc", "nfs", "iso9660").
55-
Windows: ntfs.
56-
Solaris: corresponds to "type" of the fs resource in zonecfg(8).
60+
* Linux: valid *filesystemtype* supported by the kernel as listed in */proc/filesystems* (e.g., "minix", "ext2", "ext3", "jfs", "xfs", "reiserfs", "msdos", "proc", "nfs", "iso9660").
61+
* Windows: the type of file system on the volume, e.g. "ntfs".
62+
* Solaris: corresponds to "type" of the fs resource in zonecfg(8).
5763
* **`source`** (string, REQUIRED) A device name, but can also be a directory name or a dummy.
58-
Windows: the volume name that is the target of the mount point, \\?\Volume\{GUID}\ (on Windows source is called target).
59-
Solaris: corresponds to "special" of the fs resource in zonecfg(8).
64+
* Windows: the volume name that is the target of the mount point, \\?\Volume\{GUID}\ (on Windows source is called target).
65+
* Solaris: corresponds to "special" of the fs resource in zonecfg(8).
6066
* **`options`** (list of strings, OPTIONAL) Mount options of the filesystem to be used.
61-
Linux: [supported][mount.8-filesystem-independent] [options][mount.8-filesystem-specific] are listed in [mount(8)][mount.8].
62-
Solaris: corresponds to "options" of the fs resource in zonecfg(8).
67+
* Linux: [supported][mount.8-filesystem-independent] [options][mount.8-filesystem-specific] are listed in [mount(8)][mount.8].
68+
* Solaris: corresponds to "options" of the fs resource in zonecfg(8).
6369

6470
### Example (Linux)
6571

@@ -93,8 +99,6 @@ For Solaris, the mounts corresponds to fs resource in zonecfg(8).
9399
]
94100
```
95101

96-
See links for details about [mountvol](http://ss64.com/nt/mountvol.html) and [SetVolumeMountPoint](https://msdn.microsoft.com/en-us/library/windows/desktop/aa365561(v=vs.85).aspx) in Windows.
97-
98102
### Example (Solaris)
99103

100104
```json
@@ -113,13 +117,12 @@ See links for details about [mountvol](http://ss64.com/nt/mountvol.html) and [Se
113117
]
114118
```
115119

116-
117120
## Process
118121

119-
**`process`** (object, REQUIRED) configures the container process.
122+
**`process`** (object, REQUIRED) specifies the container process.
120123

121124
* **`terminal`** (bool, OPTIONAL) specifies whether a terminal is attached to that process, defaults to false.
122-
On Linux, a pseudoterminal pair is allocated for the container process and the pseudoterminal slave is duplicated on the container process's [standard streams][stdin.3].
125+
As an example, if set to true on Linux a pseudoterminal pair is allocated for the container process and the pseudoterminal slave is duplicated on the container process's [standard streams][stdin.3].
123126
* **`consoleSize`** (object, OPTIONAL) specifies the console size of the terminal if attached, containing the following properties:
124127
* **`height`** (uint, REQUIRED)
125128
* **`width`** (uint, REQUIRED)
@@ -128,27 +131,25 @@ See links for details about [mountvol](http://ss64.com/nt/mountvol.html) and [Se
128131
* **`env`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2001's `environ`][ieee-1003.1-2001-xbd-c8.1].
129132
* **`args`** (array of strings, REQUIRED) with similar semantics to [IEEE Std 1003.1-2001 `execvp`'s *argv*][ieee-1003.1-2001-xsh-exec].
130133
This specification extends the IEEE standard in that at least one entry is REQUIRED, and that entry is used with the same semantics as `execvp`'s *file*.
131-
132-
For Linux-based systems the process structure supports the following process specific fields:
133-
134-
* **`capabilities`** (array of strings, OPTIONAL) capabilities is an array that specifies Linux capabilities that can be provided to the process inside the container.
135-
Valid values are the strings for capabilities defined in [the man page](http://man7.org/linux/man-pages/man7/capabilities.7.html).
134+
* **`capabilities`** (array of strings, OPTIONAL) is an array that specifies the set of capabilities of the process(es) inside the container. Valid values are platform-specific. For example, valid values for Linux are defined in the [CAPABILITIES(7)](http://man7.org/linux/man-pages/man7/capabilities.7.html) man page.
136135
* **`rlimits`** (array of objects, OPTIONAL) allows setting resource limits for a process inside the container.
137136
Each entry has the following structure:
138137

139-
* **`type`** (string, REQUIRED) - the 'type' field are the resources defined in [the man page](http://man7.org/linux/man-pages/man2/setrlimit.2.html).
140-
* **`soft`** (uint64, REQUIRED) - the value that the kernel enforces for the corresponding resource.
141-
* **`hard`** (uint64, REQUIRED) - the ceiling for the soft limit that could be set by an unprivileged process.
142-
Only privileged process (under Linux: one with the CAP_SYS_RESOURCE capability) can raise a hard limit.
138+
* **`type`** (string, REQUIRED) - the platform resource being limited, for example on Linux as defined in the [SETRLIMIT(2)](http://man7.org/linux/man-pages/man2/setrlimit.2.html) man page.
139+
* **`soft`** (uint64, REQUIRED) - the value of the limit enforced for the corresponding resource.
140+
* **`hard`** (uint64, REQUIRED) - the ceiling for the soft limit that could be set by an unprivileged process. Only a privileged process (e.g. under Linux: one with the CAP_SYS_RESOURCE capability) can raise a hard limit.
143141

144142
If `rlimits` contains duplicated entries with same `type`, the runtime MUST error out.
145143

146-
* **`apparmorProfile`** (string, OPTIONAL) apparmor profile specifies the name of the apparmor profile that will be used for the container.
147-
For more information about Apparmor, see [Apparmor documentation](https://wiki.ubuntu.com/AppArmor)
148-
* **`selinuxLabel`** (string, OPTIONAL) SELinux process label specifies the label with which the processes in a container are run.
149-
For more information about SELinux, see [Selinux documentation](http://selinuxproject.org/page/Main_Page)
150144
* **`noNewPrivileges`** (bool, OPTIONAL) setting `noNewPrivileges` to true prevents the processes in the container from gaining additional privileges.
151-
[The kernel doc](https://www.kernel.org/doc/Documentation/prctl/no_new_privs.txt) has more information on how this is achieved using a prctl system call.
145+
As an example, the ['no_new_privs' kernel doc](https://www.kernel.org/doc/Documentation/prctl/no_new_privs.txt) has more information on how this is achieved using a prctl system call on Linux.
146+
147+
For Linux-based systems the process structure supports the following process specific fields.
148+
149+
* **`apparmorProfile`** (string, OPTIONAL) specifies the name of the AppArmor profile to be applied to processes in the container.
150+
For more information about AppArmor, see [AppArmor documentation](https://wiki.ubuntu.com/AppArmor)
151+
* **`selinuxLabel`** (string, OPTIONAL) specifies the SELinux label to be applied to the processes in the container.
152+
For more information about SELinux, see [SELinux documentation](http://selinuxproject.org/page/Main_Page)
152153

153154
### User
154155

@@ -255,8 +256,8 @@ For Windows based systems the user structure has the following fields:
255256

256257
## Hostname
257258

258-
* **`hostname`** (string, OPTIONAL) configures the container's hostname as seen by processes running inside the container.
259-
On Linux, this will change the hostname in the [container][container-namespace] [UTS namespace][uts-namespace].
259+
* **`hostname`** (string, OPTIONAL) specifies the container's hostname as seen by processes running inside the container.
260+
On Linux, for example, this will change the hostname in the [container][container-namespace] [UTS namespace][uts-namespace].
260261
Depending on your [namespace configuration](config-linux.md#namespaces), the container UTS namespace may be the [runtime UTS namespace][runtime-namespace].
261262

262263
### Example
@@ -269,12 +270,12 @@ For Windows based systems the user structure has the following fields:
269270

270271
**`platform`** specifies the configuration's target platform.
271272

272-
* **`os`** (string, REQUIRED) specifies the operating system family this image targets.
273-
The runtime MUST generate an error if it does not support the configured **`os`**.
273+
* **`os`** (string, REQUIRED) specifies the operating system family of the container configuration's specified [`root`](#root-configuration) file system bundle.
274+
The runtime MUST generate an error if it does not support the specified **`os`**.
274275
Bundles SHOULD use, and runtimes SHOULD understand, **`os`** entries listed in the Go Language document for [`$GOOS`][go-environment].
275276
If an operating system is not included in the `$GOOS` documentation, it SHOULD be submitted to this specification for standardization.
276-
* **`arch`** (string, REQUIRED) specifies the instruction set for which the binaries in the image have been compiled.
277-
The runtime MUST generate an error if it does not support the configured **`arch`**.
277+
* **`arch`** (string, REQUIRED) specifies the instruction set for which the binaries in the specified [`root`](#root-configuration) file system bundle have been compiled.
278+
The runtime MUST generate an error if it does not support the specified **`arch`**.
278279
Values for **`arch`** SHOULD use, and runtimes SHOULD understand, **`arch`** entries listed in the Go Language document for [`$GOARCH`][go-environment].
279280
If an architecture is not included in the `$GOARCH` documentation, it SHOULD be submitted to this specification for standardization.
280281

@@ -289,14 +290,16 @@ For Windows based systems the user structure has the following fields:
289290

290291
## Platform-specific configuration
291292

292-
[**`platform.os`**](#platform) is used to lookup further platform-specific configuration.
293+
[**`platform.os`**](#platform) is used to specify platform-specific configuration.
294+
Runtime implementations MAY support any valid values for platform-specific fields as part of this configuration.
295+
Implementations MUST error out when invalid values are encountered and MUST generate an error message and error out when encountering valid values it chooses to not support.
293296

294297
* **`linux`** (object, OPTIONAL) [Linux-specific configuration](config-linux.md).
295-
This SHOULD only be set if **`platform.os`** is `linux`.
296-
* **`solaris`** (object, OPTIONAL) [Solaris-specific configuration](config-solaris.md).
297-
This SHOULD only be set if **`platform.os`** is `solaris`.
298+
This MAY be set if **`platform.os`** is `linux` and MUST NOT be set otherwise.
298299
* **`windows`** (object, OPTIONAL) [Windows-specific configuration](config-windows.md).
299-
This SHOULD only be set if **`platform.os`** is `windows`.
300+
This MAY be set if **`platform.os`** is `windows` and MUST NOT be set otherwise.
301+
* **`solaris`** (object, OPTIONAL) [Solaris-specific configuration](config-solaris.md).
302+
This MAY be set if **`platform.os`** is `solaris` and MUST NOT be set otherwise.
300303

301304
### Example (Linux)
302305

@@ -318,7 +321,7 @@ For Windows based systems the user structure has the following fields:
318321

319322
## Hooks
320323

321-
Lifecycle hooks allow custom events for different points in a container's runtime.
324+
Hooks allow for the configuration of custom actions related to the [lifecycle](runtime.md#lifecycle) of the container.
322325

323326
* **`hooks`** (object, OPTIONAL) MAY contain any of the following properties:
324327
* **`prestart`** (array, OPTIONAL) is an array of [pre-start hooks](#prestart).
@@ -333,30 +336,29 @@ Lifecycle hooks allow custom events for different points in a container's runtim
333336
* **`poststop`** (array, OPTIONAL) is an array of [post-stop hooks](#poststop).
334337
Entries in the array have the same schema as pre-start entries.
335338

336-
Hooks allow one to run programs before/after various lifecycle events of the container.
339+
Hooks allow users to specify programs to run before or after various lifecycle events.
337340
Hooks MUST be called in the listed order.
338-
The [state](runtime.md#state) of the container is passed to the hooks over stdin, so the hooks could get the information they need to do their work.
341+
The [state](runtime.md#state) of the container MUST be passed to hooks over stdin so that they may do work appropriate to the current state of the container.
339342

340343
### Prestart
341344

342-
The pre-start hooks are called after the container process is spawned, but before the user supplied command is executed.
343-
They are called after the container namespaces are created on Linux, so they provide an opportunity to customize the container.
344-
In Linux, for e.g., the network namespace could be configured in this hook.
345+
The pre-start hooks MUST be called after the container has been created, but before the user supplied command is executed.
346+
On Linux, for example, they are called after the container namespaces are created, so they provide an opportunity to customize the container (e.g. the network namespace could be specified in this hook).
345347

346-
If a hook returns a non-zero exit code, then an error including the exit code and the stderr is returned to the caller and the container is torn down.
348+
If a hook returns a non-zero exit code, an error including the exit code and the stderr MUST be returned to the caller and the container MUST be destroyed.
347349

348350
### Poststart
349351

350-
The post-start hooks are called after the user process is started.
351-
For example this hook can notify user that real process is spawned.
352+
The post-start hooks MUST be called after the user process is started.
353+
For example, this hook can notify the user that the container process is spawned.
352354

353-
If a hook returns a non-zero exit code, then an error is logged and the remaining hooks are executed.
355+
If a hook returns a non-zero exit code, then an error MUST be logged and the remaining hooks are executed.
354356

355357
### Poststop
356358

357-
The post-stop hooks are called after the container process is stopped.
358-
Cleanup or debugging could be performed in such a hook.
359-
If a hook returns a non-zero exit code, then an error is logged and the remaining hooks are executed.
359+
The post-stop hooks MUST be called after the container process is stopped.
360+
Cleanup or debugging functions are examples of such a hook.
361+
If a hook returns a non-zero exit code, then an error MUST be logged and the remaining hooks are executed.
360362

361363
### Example
362364

0 commit comments

Comments
 (0)