2017-04-12 23:12:04 +00:00
# <a name="linuxContainerConfiguration" />Linux Container Configuration
2017-02-01 00:45:59 +00:00
This document describes the schema for the [Linux-specific section ](config.md#platform-specific-configuration ) of the [container configuration ](config.md ).
2017-04-12 23:12:04 +00:00
The Linux container specification uses various kernel features like namespaces, cgroups, capabilities, LSM, and filesystem jails to fulfill the spec.
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
## <a name="configLinuxDefaultFilesystems" />Default Filesystems
2017-02-01 00:45:59 +00:00
The Linux ABI includes both syscalls and several special file paths.
2017-04-12 23:12:04 +00:00
Applications expecting a Linux environment will very likely expect these file paths to be setup correctly.
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
The following filesystems SHOULD be made available in each container's filesystem:
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
| Path | Type |
2017-02-01 00:45:59 +00:00
| -------- | ------ |
2017-04-12 23:12:04 +00:00
| /proc | [procfs][procfs] |
| /sys | [sysfs][sysfs] |
| /dev/pts | [devpts][devpts] |
| /dev/shm | [tmpfs][tmpfs] |
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
## <a name="configLinuxNamespaces" />Namespaces
2017-02-01 00:45:59 +00:00
A namespace wraps a global system resource in an abstraction that makes it appear to the processes within the namespace that they have their own isolated instance of the global resource.
Changes to the global resource are visible to other processes that are members of the namespace, but are invisible to other processes.
2017-04-12 23:12:04 +00:00
For more information, see the [namespaces(7)][namespaces.7_2] man page.
2017-02-01 00:45:59 +00:00
Namespaces are specified as an array of entries inside the `namespaces` root field.
The following parameters can be specified to setup namespaces:
2017-04-12 23:12:04 +00:00
* **`type`** *(string, REQUIRED)* - namespace type. The following namespace types are supported:
2017-02-01 00:45:59 +00:00
* **`pid`** processes inside the container will only be able to see other processes inside the same container.
* **`network`** the container will have its own network stack.
* **`mount`** the container will have an isolated mount table.
* **`ipc`** processes inside the container will only be able to communicate to other processes inside the same container via system level IPC.
* **`uts`** the container will be able to have its own hostname and domain name.
* **`user`** the container will be able to remap user and group IDs from the host to local users and groups within the container.
* **`cgroup`** the container will have an isolated view of the cgroup hierarchy.
2017-04-12 23:12:04 +00:00
* **`path`** *(string, OPTIONAL)* - path to namespace file in the [runtime mount namespace ](glossary.md#runtime-namespace )
2017-02-01 00:45:59 +00:00
If a path is specified, that particular file is used to join that type of namespace.
2017-04-12 23:12:04 +00:00
If a namespace type is not specified in the `namespaces` array, the container MUST inherit the [runtime namespace ](glossary.md#runtime-namespace ) of that type.
If a `namespaces` field contains duplicated namespaces with same `type` , the runtime MUST error out.
2017-02-01 00:45:59 +00:00
###### Example
```json
"namespaces": [
{
"type": "pid",
"path": "/proc/1234/ns/pid"
},
{
"type": "network",
"path": "/var/run/netns/neta"
},
{
"type": "mount"
},
{
"type": "ipc"
},
{
"type": "uts"
},
{
"type": "user"
},
{
"type": "cgroup"
}
]
```
2017-04-12 23:12:04 +00:00
## <a name="configLinuxUserNamespaceMappings" />User namespace mappings
**`uidMappings`** (array of objects, OPTIONAL) describes the user namespace uid mappings from the host to the container.
**`gidMappings`** (array of objects, OPTIONAL) describes the user namespace gid mappings from the host to the container.
Each entry has the following structure:
* **`hostID`** *(uint32, REQUIRED)* - is the starting uid/gid on the host to be mapped to *containerID* .
* **`containerID`** *(uint32, REQUIRED)* - is the starting uid/gid in the container.
* **`size`** *(uint32, REQUIRED)* - is the number of ids to be mapped.
The runtime SHOULD NOT modify the ownership of referenced filesystems to realize the mapping.
Note that the number of mapping entries MAY be limited by the [kernel][user-namespaces].
2017-02-01 00:45:59 +00:00
###### Example
```json
"uidMappings": [
{
"hostID": 1000,
"containerID": 0,
2017-04-12 23:12:04 +00:00
"size": 32000
2017-02-01 00:45:59 +00:00
}
],
"gidMappings": [
{
"hostID": 1000,
"containerID": 0,
2017-04-12 23:12:04 +00:00
"size": 32000
2017-02-01 00:45:59 +00:00
}
]
```
2017-04-12 23:12:04 +00:00
## <a name="configLinuxDevices" />Devices
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
**`devices`** (array of objects, OPTIONAL) lists devices that MUST be available in the container.
2017-02-01 00:45:59 +00:00
The runtime may supply them however it likes (with [mknod][mknod.2], by bind mounting from the runtime mount namespace, etc.).
2017-04-12 23:12:04 +00:00
Each entry has the following structure:
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
* **`type`** *(string, REQUIRED)* - type of device: `c` , `b` , `u` or `p` .
2017-02-01 00:45:59 +00:00
More info in [mknod(1)][mknod.1].
2017-04-12 23:12:04 +00:00
* **`path`** *(string, REQUIRED)* - full path to device inside container.
If a [file][file.1] already exists at `path` that does not match the requested device, the runtime MUST generate an error.
* **`major, minor`** *(int64, REQUIRED unless `type` is `p`)* - [major, minor numbers][devices] for the device.
* **`fileMode`** *(uint32, OPTIONAL)* - file mode for the device.
2017-02-01 00:45:59 +00:00
You can also control access to devices [with cgroups ](#device-whitelist ).
2017-04-12 23:12:04 +00:00
* **`uid`** *(uint32, OPTIONAL)* - id of device owner.
* **`gid`** *(uint32, OPTIONAL)* - id of device group.
The same `type` , `major` and `minor` SHOULD NOT be used for multiple devices.
2017-02-01 00:45:59 +00:00
###### Example
```json
"devices": [
{
"path": "/dev/fuse",
"type": "c",
"major": 10,
"minor": 229,
"fileMode": 438,
"uid": 0,
"gid": 0
},
{
"path": "/dev/sda",
"type": "b",
"major": 8,
"minor": 0,
"fileMode": 432,
"uid": 0,
"gid": 0
}
]
```
2017-04-12 23:12:04 +00:00
###### <a name="configLinuxDefaultDevices" />Default Devices
2017-02-01 00:45:59 +00:00
In addition to any devices configured with this setting, the runtime MUST also supply:
* [`/dev/null`][null.4]
* [`/dev/zero`][zero.4]
* [`/dev/full`][full.4]
* [`/dev/random`][random.4]
* [`/dev/urandom`][random.4]
* [`/dev/tty`][tty.4]
2017-04-12 23:12:04 +00:00
* [`/dev/console`][console.4] is setup if terminal is enabled in the config by bind mounting the pseudoterminal slave to /dev/console.
2017-02-01 00:45:59 +00:00
* [`/dev/ptmx`][pts.4].
A [bind-mount or symlink of the container's `/dev/pts/ptmx` ][devpts].
2017-04-12 23:12:04 +00:00
## <a name="configLinuxControlGroups" />Control groups
2017-02-01 00:45:59 +00:00
Also known as cgroups, they are used to restrict resource usage for a container and handle device access.
2017-04-12 23:12:04 +00:00
cgroups provide controls (through controllers) to restrict cpu, memory, IO, pids and network for the container.
2017-02-01 00:45:59 +00:00
For more information, see the [kernel cgroups documentation][cgroup-v1].
The path to the cgroups can be specified in the Spec via `cgroupsPath` .
2017-04-12 23:12:04 +00:00
`cgroupsPath` can be used to either control the cgroup hierarchy for containers or to run a new process in an existing container.
If `cgroupsPath` is:
* ... an absolute path (starting with `/` ), the runtime MUST take the path to be relative to the cgroup mount point.
* ... a relative path (not starting with `/` ), the runtime MAY interpret the path relative to a runtime-determined location in the cgroup hierarchy.
* ... not specified, the runtime MAY define the default cgroup path.
Runtimes MAY consider certain `cgroupsPath` values to be invalid, and MUST generate an error if this is the case.
If a `cgroupsPath` value is specified, the runtime MUST consistently attach to the same place in the cgroup hierarchy given the same value of `cgroupsPath` .
2017-02-01 00:45:59 +00:00
Implementations of the Spec can choose to name cgroups in any manner.
The Spec does not include naming schema for cgroups.
2017-04-12 23:12:04 +00:00
The Spec does not support per-controller paths for the reasons discussed in the [cgroupv2 documentation][cgroup-v2].
2017-02-01 00:45:59 +00:00
The cgroups will be created if they don't exist.
2017-04-12 23:12:04 +00:00
You can configure a container's cgroups via the `resources` field of the Linux configuration.
Do not specify `resources` unless limits have to be updated.
For example, to run a new process in an existing container without updating limits, `resources` need not be specified.
A runtime MUST at least use the minimum set of cgroup controllers required to fulfill the `resources` settings.
However, a runtime MAY attach the container process to additional cgroup controllers supported by the system.
2017-02-01 00:45:59 +00:00
###### Example
```json
2017-04-12 23:12:04 +00:00
"cgroupsPath": "/myRuntime/myContainer",
"resources": {
"memory": {
"limit": 100000,
"reservation": 200000
},
"devices": [
{
"allow": false,
"access": "rwm"
}
]
}
2017-02-01 00:45:59 +00:00
```
2017-04-12 23:12:04 +00:00
#### <a name="configLinuxDeviceWhitelist" />Device whitelist
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
**`devices`** (array of objects, OPTIONAL) configures the [device whitelist][cgroup-v1-devices].
2017-02-01 00:45:59 +00:00
The runtime MUST apply entries in the listed order.
2017-04-12 23:12:04 +00:00
Each entry has the following structure:
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
* **`allow`** *(boolean, REQUIRED)* - whether the entry is allowed or denied.
* **`type`** *(string, OPTIONAL)* - type of device: `a` (all), `c` (char), or `b` (block).
2017-02-01 00:45:59 +00:00
`null` or unset values mean "all", mapping to `a` .
2017-04-12 23:12:04 +00:00
* **`major, minor`** *(int64, OPTIONAL)* - [major, minor numbers][devices] for the device.
2017-02-01 00:45:59 +00:00
`null` or unset values mean "all", mapping to [`*` in the filesystem API][cgroup-v1-devices].
2017-04-12 23:12:04 +00:00
* **`access`** *(string, OPTIONAL)* - cgroup permissions for device.
2017-02-01 00:45:59 +00:00
A composition of `r` (read), `w` (write), and `m` (mknod).
###### Example
```json
"devices": [
{
"allow": false,
"access": "rwm"
},
{
"allow": true,
"type": "c",
"major": 10,
"minor": 229,
"access": "rw"
},
{
"allow": true,
"type": "b",
"major": 8,
"minor": 0,
"access": "r"
}
]
```
2017-04-12 23:12:04 +00:00
#### <a name="configLinuxDisableOutOfMemoryKiller" />Disable out-of-memory killer
2017-02-01 00:45:59 +00:00
`disableOOMKiller` contains a boolean (`true` or `false` ) that enables or disables the Out of Memory killer for a cgroup.
If enabled (`false`), tasks that attempt to consume more memory than they are allowed are immediately killed by the OOM killer.
The OOM killer is enabled by default in every cgroup using the `memory` subsystem.
To disable it, specify a value of `true` .
For more information, see [the memory cgroup man page][cgroup-v1-memory].
2017-04-12 23:12:04 +00:00
* **`disableOOMKiller`** *(bool, OPTIONAL)* - enables or disables the OOM killer
2017-02-01 00:45:59 +00:00
###### Example
```json
"disableOOMKiller": false
```
2017-04-12 23:12:04 +00:00
#### <a name="configLinuxSetOomScoreAdj" />Set oom_score_adj
2017-02-01 00:45:59 +00:00
`oomScoreAdj` sets heuristic regarding how the process is evaluated by the kernel during memory pressure.
2017-04-12 23:12:04 +00:00
For more information, see [the proc filesystem documentation section 3.1][procfs].
2017-02-01 00:45:59 +00:00
This is a kernel/system level setting, where as `disableOOMKiller` is scoped for a memory cgroup.
For more information on how these two settings work together, see [the memory cgroup documentation section 10. OOM Contol][cgroup-v1-memory].
2017-04-12 23:12:04 +00:00
* **`oomScoreAdj`** *(int, OPTIONAL)* - adjust the oom-killer score
2017-02-01 00:45:59 +00:00
###### Example
```json
"oomScoreAdj": 100
```
2017-04-12 23:12:04 +00:00
#### <a name="configLinuxMemory" />Memory
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
**`memory`** (object, OPTIONAL) represents the cgroup subsystem `memory` and it's used to set limits on the container's memory usage.
2017-02-01 00:45:59 +00:00
For more information, see [the memory cgroup man page][cgroup-v1-memory].
The following parameters can be specified to setup the controller:
2017-04-12 23:12:04 +00:00
* **`limit`** *(uint64, OPTIONAL)* - sets limit of memory usage in bytes
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
* **`reservation`** *(uint64, OPTIONAL)* - sets soft limit of memory usage in bytes
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
* **`swap`** *(uint64, OPTIONAL)* - sets limit of memory+Swap usage
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
* **`kernel`** *(uint64, OPTIONAL)* - sets hard limit for kernel memory
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
* **`kernelTCP`** *(uint64, OPTIONAL)* - sets hard limit in bytes for kernel TCP buffer memory
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
* **`swappiness`** *(uint64, OPTIONAL)* - sets swappiness parameter of vmscan (See sysctl's vm.swappiness)
2017-02-01 00:45:59 +00:00
###### Example
```json
"memory": {
"limit": 536870912,
"reservation": 536870912,
"swap": 536870912,
"kernel": 0,
"kernelTCP": 0,
"swappiness": 0
}
```
2017-04-12 23:12:04 +00:00
#### <a name="configLinuxCPU" />CPU
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
**`cpu`** (object, OPTIONAL) represents the cgroup subsystems `cpu` and `cpusets` .
2017-02-01 00:45:59 +00:00
For more information, see [the cpusets cgroup man page][cgroup-v1-cpusets].
The following parameters can be specified to setup the controller:
2017-04-12 23:12:04 +00:00
* **`shares`** *(uint64, OPTIONAL)* - specifies a relative share of CPU time available to the tasks in a cgroup
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
* **`quota`** *(int64, OPTIONAL)* - specifies the total amount of time in microseconds for which all tasks in a cgroup can run during one period (as defined by ** `period` ** below)
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
* **`period`** *(uint64, OPTIONAL)* - specifies a period of time in microseconds for how regularly a cgroup's access to CPU resources should be reallocated (CFS scheduler only)
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
* **`realtimeRuntime`** *(int64, OPTIONAL)* - specifies a period of time in microseconds for the longest continuous period in which the tasks in a cgroup have access to CPU resources
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
* **`realtimePeriod`** *(uint64, OPTIONAL)* - same as ** `period` ** but applies to realtime scheduler only
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
* **`cpus`** *(string, OPTIONAL)* - list of CPUs the container will run in
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
* **`mems`** *(string, OPTIONAL)* - list of Memory Nodes the container will run in
2017-02-01 00:45:59 +00:00
###### Example
```json
"cpu": {
"shares": 1024,
"quota": 1000000,
"period": 500000,
"realtimeRuntime": 950000,
"realtimePeriod": 1000000,
"cpus": "2-3",
"mems": "0-7"
}
```
2017-04-12 23:12:04 +00:00
#### <a name="configLinuxBlockIO" />Block IO
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
**`blockIO`** (object, OPTIONAL) represents the cgroup subsystem `blkio` which implements the block IO controller.
2017-02-01 00:45:59 +00:00
For more information, see [the kernel cgroups documentation about blkio][cgroup-v1-blkio].
The following parameters can be specified to setup the controller:
2017-04-12 23:12:04 +00:00
* **`blkioWeight`** *(uint16, OPTIONAL)* - specifies per-cgroup weight. This is default weight of the group on all devices until and unless overridden by per-device rules. The range is from 10 to 1000.
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
* **`blkioLeafWeight`** *(uint16, OPTIONAL)* - equivalents of `blkioWeight` for the purpose of deciding how much weight tasks in the given cgroup has while competing with the cgroup's child cgroups. The range is from 10 to 1000.
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
* **`blkioWeightDevice`** *(array, OPTIONAL)* - specifies the list of devices which will be bandwidth rate limited. The following parameters can be specified per-device:
* **`major, minor`** *(int64, REQUIRED)* - major, minor numbers for device. More info in `man mknod` .
* **`weight`** *(uint16, OPTIONAL)* - bandwidth rate for the device, range is from 10 to 1000
* **`leafWeight`** *(uint16, OPTIONAL)* - bandwidth rate for the device while competing with the cgroup's child cgroups, range is from 10 to 1000, CFQ scheduler only
2017-02-01 00:45:59 +00:00
You must specify at least one of `weight` or `leafWeight` in a given entry, and can specify both.
2017-04-12 23:12:04 +00:00
* **`blkioThrottleReadBpsDevice`**, ** `blkioThrottleWriteBpsDevice` **, ** `blkioThrottleReadIOPSDevice` **, ** `blkioThrottleWriteIOPSDevice` ** *(array, OPTIONAL)* - specify the list of devices which will be IO rate limited.
The following parameters can be specified per-device:
* **`major, minor`** *(int64, REQUIRED)* - major, minor numbers for device. More info in `man mknod` .
* **`rate`** *(uint64, REQUIRED)* - IO rate limit for the device
2017-02-01 00:45:59 +00:00
###### Example
```json
"blockIO": {
"blkioWeight": 10,
"blkioLeafWeight": 10,
"blkioWeightDevice": [
{
"major": 8,
"minor": 0,
"weight": 500,
"leafWeight": 300
},
{
"major": 8,
"minor": 16,
"weight": 500
}
],
"blkioThrottleReadBpsDevice": [
{
"major": 8,
"minor": 0,
"rate": 600
}
],
"blkioThrottleWriteIOPSDevice": [
{
"major": 8,
"minor": 16,
"rate": 300
}
]
}
```
2017-04-12 23:12:04 +00:00
#### <a name="configLinuxHugePageLimits" />Huge page limits
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
**`hugepageLimits`** (array of objects, OPTIONAL) represents the `hugetlb` controller which allows to limit the
2017-02-01 00:45:59 +00:00
HugeTLB usage per control group and enforces the controller limit during page fault.
For more information, see the [kernel cgroups documentation about HugeTLB][cgroup-v1-hugetlb].
2017-04-12 23:12:04 +00:00
Each entry has the following structure:
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
* **`pageSize`** *(string, REQUIRED)* - hugepage size
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
* **`limit`** *(uint64, REQUIRED)* - limit in bytes of *hugepagesize* HugeTLB usage
2017-02-01 00:45:59 +00:00
###### Example
```json
"hugepageLimits": [
{
"pageSize": "2MB",
2017-04-12 23:12:04 +00:00
"limit": 209715200
2017-02-01 00:45:59 +00:00
}
]
```
2017-04-12 23:12:04 +00:00
#### <a name="configLinuxNetwork" />Network
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
**`network`** (object, OPTIONAL) represents the cgroup subsystems `net_cls` and `net_prio` .
2017-02-01 00:45:59 +00:00
For more information, see [the net\_cls cgroup man page][cgroup-v1-net-cls] and [the net\_prio cgroup man page][cgroup-v1-net-prio].
2017-04-12 23:12:04 +00:00
The following parameters can be specified to setup the controller:
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
* **`classID`** *(uint32, OPTIONAL)* - is the network class identifier the cgroup's network packets will be tagged with
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
* **`priorities`** *(array, OPTIONAL)* - specifies a list of objects of the priorities assigned to traffic originating from processes in the group and egressing the system on various interfaces.
The following parameters can be specified per-priority:
* **`name`** *(string, REQUIRED)* - interface name
* **`priority`** *(uint32, REQUIRED)* - priority applied to the interface
2017-02-01 00:45:59 +00:00
###### Example
```json
"network": {
"classID": 1048577,
"priorities": [
{
"name": "eth0",
"priority": 500
},
{
"name": "eth1",
"priority": 1000
}
]
}
```
2017-04-12 23:12:04 +00:00
#### <a name="configLinuxPIDS" />PIDs
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
**`pids`** (object, OPTIONAL) represents the cgroup subsystem `pids` .
2017-02-01 00:45:59 +00:00
For more information, see [the pids cgroup man page][cgroup-v1-pids].
The following parameters can be specified to setup the controller:
2017-04-12 23:12:04 +00:00
* **`limit`** *(int64, REQUIRED)* - specifies the maximum number of tasks in the cgroup
2017-02-01 00:45:59 +00:00
###### Example
```json
"pids": {
"limit": 32771
}
```
2017-04-12 23:12:04 +00:00
## <a name="configLinuxSysctl" />Sysctl
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
**`sysctl`** (object, OPTIONAL) allows kernel parameters to be modified at runtime for the container.
For more information, see the [sysctl(8)][sysctl.8] man page.
2017-02-01 00:45:59 +00:00
###### Example
```json
"sysctl": {
"net.ipv4.ip_forward": "1",
"net.core.somaxconn": "256"
}
```
2017-04-12 23:12:04 +00:00
## <a name="configLinuxSeccomp" />Seccomp
2017-02-01 00:45:59 +00:00
Seccomp provides application sandboxing mechanism in the Linux kernel.
Seccomp configuration allows one to configure actions to take for matched syscalls and furthermore also allows matching on values passed as arguments to syscalls.
2017-04-12 23:12:04 +00:00
For more information about Seccomp, see [Seccomp][seccomp] kernel documentation.
The actions, architectures, and operators are strings that match the definitions in seccomp.h from [libseccomp][] and are translated to corresponding values.
A valid list of constants as of libseccomp v2.3.2 is shown below.
2017-02-01 00:45:59 +00:00
Architecture Constants
* `SCMP_ARCH_X86`
* `SCMP_ARCH_X86_64`
* `SCMP_ARCH_X32`
* `SCMP_ARCH_ARM`
* `SCMP_ARCH_AARCH64`
* `SCMP_ARCH_MIPS`
* `SCMP_ARCH_MIPS64`
* `SCMP_ARCH_MIPS64N32`
* `SCMP_ARCH_MIPSEL`
* `SCMP_ARCH_MIPSEL64`
* `SCMP_ARCH_MIPSEL64N32`
* `SCMP_ARCH_PPC`
* `SCMP_ARCH_PPC64`
* `SCMP_ARCH_PPC64LE`
* `SCMP_ARCH_S390`
* `SCMP_ARCH_S390X`
2017-04-12 23:12:04 +00:00
* `SCMP_ARCH_PARISC`
* `SCMP_ARCH_PARISC64`
2017-02-01 00:45:59 +00:00
Action Constants:
* `SCMP_ACT_KILL`
* `SCMP_ACT_TRAP`
* `SCMP_ACT_ERRNO`
* `SCMP_ACT_TRACE`
* `SCMP_ACT_ALLOW`
Operator Constants:
* `SCMP_CMP_NE`
* `SCMP_CMP_LT`
* `SCMP_CMP_LE`
* `SCMP_CMP_EQ`
* `SCMP_CMP_GE`
* `SCMP_CMP_GT`
* `SCMP_CMP_MASKED_EQ`
###### Example
```json
"seccomp": {
"defaultAction": "SCMP_ACT_ALLOW",
"architectures": [
2017-04-12 23:12:04 +00:00
"SCMP_ARCH_X86",
"SCMP_ARCH_X32"
2017-02-01 00:45:59 +00:00
],
"syscalls": [
{
2017-04-12 23:12:04 +00:00
"names": [
"getcwd",
"chmod"
],
"action": "SCMP_ACT_ERRNO",
"comment": "stop exploit x"
2017-02-01 00:45:59 +00:00
}
]
}
```
2017-04-12 23:12:04 +00:00
## <a name="configLinuxRootfsMountPropagation" />Rootfs Mount Propagation
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
**`rootfsPropagation`** (string, OPTIONAL) sets the rootfs's mount propagation.
2017-02-01 00:45:59 +00:00
Its value is either slave, private, or shared.
2017-04-12 23:12:04 +00:00
The [Shared Subtrees][sharedsubtree] article in the kernel documentation has more information about mount propagation.
2017-02-01 00:45:59 +00:00
###### Example
```json
"rootfsPropagation": "slave",
```
2017-04-12 23:12:04 +00:00
## <a name="configLinuxMaskedPaths" />Masked Paths
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
**`maskedPaths`** (array of strings, OPTIONAL) will mask over the provided paths inside the container so that they cannot be read.
The values MUST be absolute paths in the [container namespace][container-namespace2].
2017-02-01 00:45:59 +00:00
###### Example
```json
"maskedPaths": [
"/proc/kcore"
]
```
2017-04-12 23:12:04 +00:00
## <a name="configLinuxReadonlyPaths" />Readonly Paths
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
**`readonlyPaths`** (array of strings, OPTIONAL) will set the provided paths as readonly inside the container.
The values MUST be absolute paths in the [container namespace][container-namespace2].
2017-02-01 00:45:59 +00:00
###### Example
```json
"readonlyPaths": [
"/proc/sys"
]
```
2017-04-12 23:12:04 +00:00
## <a name"configLinuxMountLabel" />Mount Label
2017-02-01 00:45:59 +00:00
2017-04-12 23:12:04 +00:00
**`mountLabel`** (string, OPTIONAL) will set the Selinux context for the mounts in the container.
2017-02-01 00:45:59 +00:00
###### Example
```json
"mountLabel": "system_u:object_r:svirt_sandbox_file_t:s0:c715,c811"
```
2017-04-12 23:12:04 +00:00
[container-namespace2]: glossary.md#container_namespace
2017-02-01 00:45:59 +00:00
[cgroup-v1]: https://www.kernel.org/doc/Documentation/cgroup-v1/cgroups.txt
[cgroup-v1-blkio]: https://www.kernel.org/doc/Documentation/cgroup-v1/blkio-controller.txt
[cgroup-v1-cpusets]: https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt
[cgroup-v1-devices]: https://www.kernel.org/doc/Documentation/cgroup-v1/devices.txt
[cgroup-v1-hugetlb]: https://www.kernel.org/doc/Documentation/cgroup-v1/hugetlb.txt
[cgroup-v1-memory]: https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
[cgroup-v1-net-cls]: https://www.kernel.org/doc/Documentation/cgroup-v1/net_cls.txt
[cgroup-v1-net-prio]: https://www.kernel.org/doc/Documentation/cgroup-v1/net_prio.txt
[cgroup-v1-pids]: https://www.kernel.org/doc/Documentation/cgroup-v1/pids.txt
[cgroup-v2]: https://www.kernel.org/doc/Documentation/cgroup-v2.txt
[devices]: https://www.kernel.org/doc/Documentation/devices.txt
[devpts]: https://www.kernel.org/doc/Documentation/filesystems/devpts.txt
2017-04-12 23:12:04 +00:00
[file]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_164
[libseccomp]: https://github.com/seccomp/libseccomp
[procfs]: https://www.kernel.org/doc/Documentation/filesystems/proc.txt
[seccomp]: https://www.kernel.org/doc/Documentation/prctl/seccomp_filter.txt
[sharedsubtree]: https://www.kernel.org/doc/Documentation/filesystems/sharedsubtree.txt
[sysfs]: https://www.kernel.org/doc/Documentation/filesystems/sysfs.txt
[tmpfs]: https://www.kernel.org/doc/Documentation/filesystems/tmpfs.txt
2017-02-01 00:45:59 +00:00
[console.4]: http://man7.org/linux/man-pages/man4/console.4.html
[full.4]: http://man7.org/linux/man-pages/man4/full.4.html
2017-04-12 23:12:04 +00:00
[mknod.1]: http://man7.org/linux/man-pages/man1/mknod.1.html
[mknod.2]: http://man7.org/linux/man-pages/man2/mknod.2.html
[namespaces.7_2]: http://man7.org/linux/man-pages/man7/namespaces.7.html
2017-02-01 00:45:59 +00:00
[null.4]: http://man7.org/linux/man-pages/man4/null.4.html
[pts.4]: http://man7.org/linux/man-pages/man4/pts.4.html
[random.4]: http://man7.org/linux/man-pages/man4/random.4.html
2017-04-12 23:12:04 +00:00
[sysctl.8]: http://man7.org/linux/man-pages/man8/sysctl.8.html
2017-02-01 00:45:59 +00:00
[tty.4]: http://man7.org/linux/man-pages/man4/tty.4.html
[zero.4]: http://man7.org/linux/man-pages/man4/zero.4.html
2017-04-12 23:12:04 +00:00
[user-namespaces]: http://man7.org/linux/man-pages/man7/user_namespaces.7.html