Skip to content

Commit

Permalink
config: Split platform-specific configuration into its own section (#414
Browse files Browse the repository at this point in the history
)

To make it clear that the whole 'linux' section is optional.

Signed-off-by: W. Trevor King <wking@tremily.us>
  • Loading branch information
wking authored and vbatts committed May 2, 2016
1 parent 45f7ada commit b373a15
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config-linux.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Linux-specific Container Configuration

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

## Default File Systems

Expand Down
28 changes: 25 additions & 3 deletions config.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ _Note: symbolic name for uid and gid, such as uname and gname respectively, are
"hostname": "mrsdalloway"
```

## Platform-specific configuration
## Platform

* **`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).
* **`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).
Expand All @@ -179,8 +179,30 @@ _Note: symbolic name for uid and gid, such as uname and gname respectively, are
}
```

Interpretation of the platform section of the JSON file is used to find which platform-specific sections may be available in the document.
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`.
## Platform-specific configuration

[**`platform.os`**](#platform) is used to lookup further platform-specific configuration.

* **`linux`** (object, optional) [Linux-specific configuration](config-linux.md).
This should only be set if **`platform.os`** is `linux`.

### Example (Linux)

```json
{
"platform": {
"os": "linux",
"arch": "amd64"
},
"linux": {
"namespaces": [
{
"type": "pid"
}
]
}
}
```

## Hooks

Expand Down

0 comments on commit b373a15

Please sign in to comment.