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
**`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
[**`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.
0 commit comments