Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config: Split platform-specific configuration into its own section #414

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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