You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This document describes the schema for the [Linux-specific section](config.md#platform-specific-configuration) of the [container configuration](config.md).
4
4
The Linux container specification uses various kernel features like namespaces, cgroups, capabilities, LSM, and filesystem jails to fulfill the spec.
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.
23
23
Changes to the global resource are visible to other processes that are members of the namespace, but are invisible to other processes.
@@ -71,7 +71,7 @@ If a `namespaces` field contains duplicated namespaces with same `type`, the run
`oomScoreAdj` sets heuristic regarding how the process is evaluated by the kernel during memory pressure.
269
269
For more information, see [the proc filesystem documentation section 3.1](https://www.kernel.org/doc/Documentation/filesystems/proc.txt).
@@ -278,7 +278,7 @@ For more information on how these two settings work together, see [the memory cg
278
278
"oomScoreAdj": 100
279
279
```
280
280
281
-
#### Memory
281
+
#### <aname="configLinuxMemory" />Memory
282
282
283
283
**`memory`** (object, OPTIONAL) represents the cgroup subsystem `memory` and it's used to set limits on the container's memory usage.
284
284
For more information, see [the memory cgroup man page][cgroup-v1-memory].
@@ -310,7 +310,7 @@ The following parameters can be specified to setup the controller:
310
310
}
311
311
```
312
312
313
-
#### CPU
313
+
#### <aname="configLinuxCPU" />CPU
314
314
315
315
**`cpu`** (object, OPTIONAL) represents the cgroup subsystems `cpu` and `cpusets`.
316
316
For more information, see [the cpusets cgroup man page][cgroup-v1-cpusets].
@@ -345,7 +345,7 @@ The following parameters can be specified to setup the controller:
345
345
}
346
346
```
347
347
348
-
#### Block IO Controller
348
+
#### <aname="configLinuxBlockIO" />Block IO
349
349
350
350
**`blockIO`** (object, OPTIONAL) represents the cgroup subsystem `blkio` which implements the block IO controller.
351
351
For more information, see [the kernel cgroups documentation about blkio][cgroup-v1-blkio].
@@ -404,7 +404,7 @@ The following parameters can be specified to setup the controller:
**`hugepageLimits`** (array of objects, OPTIONAL) represents the `hugetlb` controller which allows to limit the
410
410
HugeTLB usage per control group and enforces the controller limit during page fault.
@@ -427,7 +427,7 @@ Each entry has the following structure:
427
427
]
428
428
```
429
429
430
-
#### Network
430
+
#### <aname="configLinuxNetwork" />Network
431
431
432
432
**`network`** (object, OPTIONAL) represents the cgroup subsystems `net_cls` and `net_prio`.
433
433
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].
@@ -459,7 +459,7 @@ The following parameters can be specified to setup the controller:
459
459
}
460
460
```
461
461
462
-
#### PIDs
462
+
#### <aname="configLinuxPIDS" />PIDs
463
463
464
464
**`pids`** (object, OPTIONAL) represents the cgroup subsystem `pids`.
465
465
For more information, see [the pids cgroup man page][cgroup-v1-pids].
@@ -476,7 +476,7 @@ The following parameters can be specified to setup the controller:
476
476
}
477
477
```
478
478
479
-
## Sysctl
479
+
## <aname="configLinuxSysctl" />Sysctl
480
480
481
481
**`sysctl`** (object, OPTIONAL) allows kernel parameters to be modified at runtime for the container.
482
482
For more information, see [the man page](http://man7.org/linux/man-pages/man8/sysctl.8.html)
@@ -490,7 +490,7 @@ For more information, see [the man page](http://man7.org/linux/man-pages/man8/sy
490
490
}
491
491
```
492
492
493
-
## seccomp
493
+
## <aname="configLinuxSeccomp" />Seccomp
494
494
495
495
Seccomp provides application sandboxing mechanism in the Linux kernel.
496
496
Seccomp configuration allows one to configure actions to take for matched syscalls and furthermore also allows matching on values passed as arguments to syscalls.
@@ -554,7 +554,7 @@ Operator Constants:
554
554
}
555
555
```
556
556
557
-
## Rootfs Mount Propagation
557
+
## <aname="configLinuxRootfsMountPropagation" />Rootfs Mount Propagation
558
558
559
559
**`rootfsPropagation`** (string, OPTIONAL) sets the rootfs's mount propagation.
560
560
Its value is either slave, private, or shared.
@@ -566,7 +566,7 @@ Its value is either slave, private, or shared.
566
566
"rootfsPropagation": "slave",
567
567
```
568
568
569
-
## Masked Paths
569
+
## <aname="configLinuxMaskedPaths" />Masked Paths
570
570
571
571
**`maskedPaths`** (array of strings, OPTIONAL) will mask over the provided paths inside the container so that they cannot be read.
572
572
The values MUST be absolute paths in the [container namespace][container-namespace2].
@@ -579,7 +579,7 @@ The values MUST be absolute paths in the [container namespace][container-namespa
The container's top-level directory MUST contain a configuration file called `config.json`.
4
4
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).
@@ -13,7 +13,7 @@ Platform-specific fields are identified as such.
13
13
For all platform-specific configuration values, the scope defined below in the [Platform-specific configuration](#platform-specific-configuration) section applies.
14
14
15
15
16
-
## Specification version
16
+
## <aname="configSpecificationVersion" />Specification version
17
17
18
18
***`ociVersion`** (string, REQUIRED) MUST be in [SemVer v2.0.0](http://semver.org/spec/v2.0.0.html) format and specifies the version of the Open Container Runtime Specification with which the bundle complies.
19
19
The Open Container Runtime Specification follows semantic versioning and retains forward and backward compatibility within major versions.
@@ -25,7 +25,7 @@ For example, if a configuration is compliant with version 1.1 of this specificat
25
25
"ociVersion": "0.1.0"
26
26
```
27
27
28
-
## Root Configuration
28
+
## <aname="configRoot" />Root
29
29
30
30
**`root`** (object, REQUIRED) specifies the container's root filesystem.
31
31
@@ -44,7 +44,7 @@ For example, if a configuration is compliant with version 1.1 of this specificat
The runtime MUST mount entries in the listed order.
@@ -118,7 +118,7 @@ For Windows, see links for details about [mountvol](http://ss64.com/nt/mountvol.
118
118
]
119
119
```
120
120
121
-
## Process
121
+
## <aname="configProcess" />Process
122
122
123
123
**`process`** (object, REQUIRED) specifies the container process.
124
124
@@ -158,11 +158,11 @@ For Linux-based systems the process structure supports the following process spe
158
158
***`selinuxLabel`** (string, OPTIONAL) specifies the SELinux label to be applied to the processes in the container.
159
159
For more information about SELinux, see [SELinux documentation](http://selinuxproject.org/page/Main_Page)
160
160
161
-
### User
161
+
### <aname="configUser" />User
162
162
163
163
The user for the process is a platform-specific structure that allows specific control over which user the process runs as.
164
164
165
-
#### Linux and Solaris User
165
+
#### <aname="configLinuxAndSolarisUser" />Linux and Solaris User
166
166
167
167
For Linux and Solaris based systems the user structure has the following fields:
168
168
@@ -255,7 +255,7 @@ _Note: symbolic name for uid and gid, such as uname and gname respectively, are
255
255
}
256
256
```
257
257
258
-
#### Windows User
258
+
#### <aname="configWindowsUser" />Windows User
259
259
260
260
For Windows based systems the user structure has the following fields:
261
261
@@ -280,7 +280,7 @@ For Windows based systems the user structure has the following fields:
280
280
```
281
281
282
282
283
-
## Hostname
283
+
## <aname="configHostname" />Hostname
284
284
285
285
***`hostname`** (string, OPTIONAL) specifies the container's hostname as seen by processes running inside the container.
286
286
On Linux, for example, this will change the hostname in the [container][container-namespace][UTS namespace][uts-namespace].
@@ -292,7 +292,7 @@ For Windows based systems the user structure has the following fields:
292
292
"hostname": "mrsdalloway"
293
293
```
294
294
295
-
## Platform
295
+
## <aname="configPlatform" />Platform
296
296
297
297
**`platform`** (object, REQUIRED) specifies the configuration's target platform.
298
298
@@ -314,7 +314,7 @@ For Windows based systems the user structure has the following fields:
[**`platform.os`**](#platform) is used to specify platform-specific configuration.
320
320
Runtime implementations MAY support any valid values for platform-specific fields as part of this configuration.
@@ -345,7 +345,7 @@ Implementations MUST error out when invalid values are encountered and MUST gene
345
345
}
346
346
```
347
347
348
-
## Hooks
348
+
## <aname="configHooks" />Hooks
349
349
350
350
Hooks allow for the configuration of custom actions related to the [lifecycle](runtime.md#lifecycle) of the container.
351
351
@@ -366,21 +366,21 @@ Hooks allow users to specify programs to run before or after various lifecycle e
366
366
Hooks MUST be called in the listed order.
367
367
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.
368
368
369
-
### Prestart
369
+
### <aname="configHooksPrestart" />Prestart
370
370
371
371
The pre-start hooks MUST be called after the container has been created, but before the user supplied command is executed.
372
372
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).
373
373
374
374
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.
375
375
376
-
### Poststart
376
+
### <aname="configHooksPoststart" />Poststart
377
377
378
378
The post-start hooks MUST be called after the user process is started.
379
379
For example, this hook can notify the user that the container process is spawned.
380
380
381
381
If a hook returns a non-zero exit code, then an error MUST be logged and the remaining hooks are executed.
382
382
383
-
### Poststop
383
+
### <aname="configHooksPoststop" />Poststop
384
384
385
385
The post-stop hooks MUST be called after the container process is stopped.
386
386
Cleanup or debugging functions are examples of such a hook.
@@ -415,7 +415,7 @@ If a hook returns a non-zero exit code, then an error MUST be logged and the rem
415
415
}
416
416
```
417
417
418
-
## Annotations
418
+
## <aname="configAnnotations" />Annotations
419
419
420
420
**`annotations`** (object, OPTIONAL) contains arbitrary metadata for the container.
421
421
This information MAY be structured or unstructured.
@@ -438,7 +438,7 @@ Values MAY be an empty string.
438
438
}
439
439
```
440
440
441
-
## Extensibility
441
+
## <aname="configExtensibility" />Extensibility
442
442
Implementations that are reading/processing this configuration file MUST NOT generate an error if they encounter an unknown property.
Copy file name to clipboardExpand all lines: implementations.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,18 @@
1
-
# Implementations
1
+
# <aname="implementations" />Implementations
2
2
3
3
The following sections link to associated projects, some of which are maintained by the OCI and some of which are maintained by external organizations.
4
4
If you know of any associated projects that are not listed here, please file a pull request adding a link to that project.
*[kunalkushwaha/octool](https://github.com/kunalkushwaha/octool) - A config linter and validator.
18
18
*[huawei-openlab/oct](https://github.com/huawei-openlab/oct) - Open Container Testing framework for OCI configuration and runtime
0 commit comments