Skip to content

Commit b373a15

Browse files
wkingvbatts
authored andcommitted
config: Split platform-specific configuration into its own section (opencontainers#414)
To make it clear that the whole 'linux' section is optional. Signed-off-by: W. Trevor King <[email protected]>
1 parent 45f7ada commit b373a15

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

config-linux.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Linux-specific Container Configuration
22

3+
This document describes the schema for the [Linux-specific section](config.md#platform-specific-configuration) of the [container configuration](config.md).
34
The Linux container specification uses various kernel features like namespaces, cgroups, capabilities, LSM, and file system jails to fulfill the spec.
4-
Additional information is needed for Linux over the [default spec configuration](config.md) in order to configure these various kernel features.
55

66
## Default File Systems
77

config.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ _Note: symbolic name for uid and gid, such as uname and gname respectively, are
165165
"hostname": "mrsdalloway"
166166
```
167167

168-
## Platform-specific configuration
168+
## Platform
169169

170170
* **`os`** (string, required) specifies the operating system family this image must run on. Values for os must be in the list specified by the Go Language document for [`$GOOS`](https://golang.org/doc/install/source#environment).
171171
* **`arch`** (string, required) specifies the instruction set for which the binaries in the image have been compiled. Values for arch must be in the list specified by the Go Language document for [`$GOARCH`](https://golang.org/doc/install/source#environment).
@@ -179,8 +179,30 @@ _Note: symbolic name for uid and gid, such as uname and gname respectively, are
179179
}
180180
```
181181

182-
Interpretation of the platform section of the JSON file is used to find which platform-specific sections may be available in the document.
183-
For example, if `os` is set to `linux`, then a JSON object conforming to the [Linux-specific schema](config-linux.md) SHOULD be found at the key `linux` in the `config.json`.
182+
## Platform-specific configuration
183+
184+
[**`platform.os`**](#platform) is used to lookup further platform-specific configuration.
185+
186+
* **`linux`** (object, optional) [Linux-specific configuration](config-linux.md).
187+
This should only be set if **`platform.os`** is `linux`.
188+
189+
### Example (Linux)
190+
191+
```json
192+
{
193+
"platform": {
194+
"os": "linux",
195+
"arch": "amd64"
196+
},
197+
"linux": {
198+
"namespaces": [
199+
{
200+
"type": "pid"
201+
}
202+
]
203+
}
204+
}
205+
```
184206

185207
## Hooks
186208

0 commit comments

Comments
 (0)