-
Notifications
You must be signed in to change notification settings - Fork 611
Expand file tree
/
Copy pathconfig.md
More file actions
860 lines (763 loc) · 30.4 KB
/
config.md
File metadata and controls
860 lines (763 loc) · 30.4 KB
Edit and raw actions
OlderNewer
1
# <a name="containerConfigurationFile" />Container Configuration file
2
3
This configuration file contains metadata necessary to implement [standard operations](runtime.md#operations) against the container.
4
This includes the process to run, environment variables to inject, sandboxing features to use, etc.
5
6
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).
7
[Platform](spec.md#platforms)-specific configuration schema are defined in the [platform-specific documents](#platform-specific-configuration) linked below.
8
For properties that are only defined for some [platforms](spec.md#platforms), the Go property has a `platform` tag listing those protocols (e.g. `platform:"linux,solaris"`).
9
10
Below is a detailed description of each field defined in the configuration format and valid values are specified.
11
Platform-specific fields are identified as such.
12
For all platform-specific configuration values, the scope defined below in the [Platform-specific configuration](#platform-specific-configuration) section applies.
13
14
15
## <a name="configSpecificationVersion" />Specification version
16
17
* **`ociVersion`** (string, REQUIRED) MUST be in [SemVer v2.0.0][semver-v2.0.0] format and specifies the version of the Open Container Runtime Specification with which the bundle complies.
18
The Open Container Runtime Specification follows semantic versioning and retains forward and backward compatibility within major versions.
19
For example, if a configuration is compliant with version 1.1 of this specification, it is compatible with all runtimes that support any 1.1 or later release of this specification, but is not compatible with a runtime that supports 1.0 and not 1.1.
20
21
### Example
22
23
```json
24
"ociVersion": "0.1.0"
25
```
26
27
## <a name="configRoot" />Root
28
29
**`root`** (object, OPTIONAL) specifies the container's root filesystem.
30
On Windows, for Windows Server Containers, this field is REQUIRED.
31
For [Hyper-V Containers](config-windows.md#hyperv), this field MUST NOT be set.
32
33
On all other platforms, this field is REQUIRED.
34
35
* **`path`** (string, REQUIRED) Specifies the path to the root filesystem for the container.
36
37
* On Windows, `path` MUST be a [volume GUID path][naming-a-volume].
38
39
* On POSIX platforms, `path` is either an absolute path or a relative path to the bundle.
40
For example, with a bundle at `/to/bundle` and a root filesystem at `/to/bundle/rootfs`, the `path` value can be either `/to/bundle/rootfs` or `rootfs`.
41
The value SHOULD be the conventional `rootfs`.
42
43
A directory MUST exist at the path declared by the field.
44
45
* **`readonly`** (bool, OPTIONAL) If true then the root filesystem MUST be read-only inside the container, defaults to false.
46
* On Windows, this field MUST be omitted or false.
47
48
### Example (POSIX platforms)
49
50
```json
51
"root": {
52
"path": "rootfs",
53
"readonly": true
54
}
55
```
56
57
### Example (Windows)
58
59
```json
60
"root": {
61
"path": "\\\\?\\Volume{ec84d99e-3f02-11e7-ac6c-00155d7682cf}\\"
62
}
63
```
64
65
## <a name="configMounts" />Mounts
66
67
**`mounts`** (array of objects, OPTIONAL) specifies additional mounts beyond [`root`](#root).
68
The runtime MUST mount entries in the listed order.
69
For Linux, the parameters are as documented in [mount(2)][mount.2] system call man page.
70
For Solaris, the mount entry corresponds to the 'fs' resource in the [zonecfg(1M)][zonecfg.1m] man page.
71
72
* **`destination`** (string, REQUIRED) Destination of mount point: path inside container.
73
This value MUST be an absolute path.
74
* Windows: one mount destination MUST NOT be nested within another mount (e.g., c:\\foo and c:\\foo\\bar).
75
* Solaris: corresponds to "dir" of the fs resource in [zonecfg(1M)][zonecfg.1m].
76
* **`source`** (string, OPTIONAL) A device name, but can also be a directory name or a dummy.
77
Path values are either absolute or relative to the bundle.
78
* Windows: a local directory on the filesystem of the container host. UNC paths and mapped drives are not supported.
79
* Solaris: corresponds to "special" of the fs resource in [zonecfg(1M)][zonecfg.1m].
80
* **`options`** (array of strings, OPTIONAL) Mount options of the filesystem to be used.
81
* Linux: supported options are listed in the [mount(8)][mount.8] man page.
82
Note both [filesystem-independent][mount.8-filesystem-independent] and [filesystem-specific][mount.8-filesystem-specific] options are listed.
83
* Solaris: corresponds to "options" of the fs resource in [zonecfg(1M)][zonecfg.1m].
84
* Windows: runtimes MUST support `ro`, mounting the filesystem read-only when `ro` is given.
85
86
### Example (Windows)
87
88
```json
89
"mounts": [
90
{
91
"destination": "C:\\folder-inside-container",
92
"source": "C:\\folder-on-host",
93
"options": ["ro"]
94
}
95
]
96
```
97
98
### <a name="configPOSIXMounts" />POSIX-platform Mounts
99
100
For POSIX platforms the `mounts` structure has the following fields:
101
102
* **`type`** (string, OPTIONAL) The type of the filesystem to be mounted.
103
* Linux: filesystem types supported by the kernel as listed in */proc/filesystems* (e.g., "minix", "ext2", "ext3", "jfs", "xfs", "reiserfs", "msdos", "proc", "nfs", "iso9660").
104
* Solaris: corresponds to "type" of the fs resource in [zonecfg(1M)][zonecfg.1m].
105
106
### Example (Linux)
107
108
```json
109
"mounts": [
110
{
111
"destination": "/tmp",
112
"type": "tmpfs",
113
"source": "tmpfs",
114
"options": ["nosuid","strictatime","mode=755","size=65536k"]
115
},
116
{
117
"destination": "/data",
118
"type": "bind",
119
"source": "/volumes/testing",
120
"options": ["rbind","rw"]
121
}
122
]
123
```
124
125
### Example (Solaris)
126
127
```json
128
"mounts": [
129
{
130
"destination": "/opt/local",
131
"type": "lofs",
132
"source": "/usr/local",
133
"options": ["ro","nodevices"]
134
},
135
{
136
"destination": "/opt/sfw",
137
"type": "lofs",
138
"source": "/opt/sfw"
139
}
140
]
141
```
142
143
## <a name="configProcess" />Process
144
145
**`process`** (object, OPTIONAL) specifies the container process.
146
This property is REQUIRED when [`start`](runtime.md#start) is called.
147
148
* **`terminal`** (bool, OPTIONAL) specifies whether a terminal is attached to the process, defaults to false.
149
As an example, if set to true on Linux a pseudoterminal pair is allocated for the process and the pseudoterminal slave is duplicated on the process's [standard streams][stdin.3].
150
* **`consoleSize`** (object, OPTIONAL) specifies the console size in characters of the terminal.
151
Runtimes MUST ignore `consoleSize` if `terminal` is `false` or unset.
152
* **`height`** (uint, REQUIRED)
153
* **`width`** (uint, REQUIRED)
154
* **`cwd`** (string, REQUIRED) is the working directory that will be set for the executable.
155
This value MUST be an absolute path.
156
* **`env`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2008's `environ`][ieee-1003.1-2008-xbd-c8.1].
157
* **`args`** (array of strings, REQUIRED) with similar semantics to [IEEE Std 1003.1-2008 `execvp`'s *argv*][ieee-1003.1-2008-xsh-exec].
158
This specification extends the IEEE standard in that at least one entry is REQUIRED, and that entry is used with the same semantics as `execvp`'s *file*.
159
160
### <a name="configPOSIXProcess" />POSIX process
161
162
For systems that support POSIX rlimits (for example Linux and Solaris), the `process` object supports the following process-specific properties:
163
164
* **`rlimits`** (array of objects, OPTIONAL) allows setting resource limits for the process.
165
Each entry has the following structure:
166
167
* **`type`** (string, REQUIRED) the platform resource being limited.
168
* Linux: valid values are defined in the [`getrlimit(2)`][getrlimit.2] man page, such as `RLIMIT_MSGQUEUE`.
169
* Solaris: valid values are defined in the [`getrlimit(3)`][getrlimit.3] man page, such as `RLIMIT_CORE`.
170
171
The runtime MUST [generate an error](runtime.md#errors) for any values which cannot be mapped to a relevant kernel interface
172
For each entry in `rlimits`, a [`getrlimit(3)`][getrlimit.3] on `type` MUST succeed.
173
For the following properties, `rlim` refers to the status returned by the `getrlimit(3)` call.
174
175
* **`soft`** (uint64, REQUIRED) the value of the limit enforced for the corresponding resource.
176
`rlim.rlim_cur` MUST match the configured value.
177
* **`hard`** (uint64, REQUIRED) the ceiling for the soft limit that could be set by an unprivileged process.
178
`rlim.rlim_max` MUST match the configured value.
179
Only a privileged process (e.g. one with the `CAP_SYS_RESOURCE` capability) can raise a hard limit.
180
181
If `rlimits` contains duplicated entries with same `type`, the runtime MUST [generate an error](runtime.md#errors).
182
183
### <a name="configLinuxProcess" />Linux Process
184
185
For Linux-based systems, the `process` object supports the following process-specific properties.
186
187
* **`apparmorProfile`** (string, OPTIONAL) specifies the name of the AppArmor profile for the process.
188
For more information about AppArmor, see [AppArmor documentation][apparmor].
189
* **`capabilities`** (object, OPTIONAL) is an object containing arrays that specifies the sets of capabilities for the process.
190
Valid values are defined in the [capabilities(7)][capabilities.7] man page, such as `CAP_CHOWN`.
191
Any value which cannot be mapped to a relevant kernel interface MUST cause an error.
192
`capabilities` contains the following properties:
193
194
* **`effective`** (array of strings, OPTIONAL) the `effective` field is an array of effective capabilities that are kept for the process.
195
* **`bounding`** (array of strings, OPTIONAL) the `bounding` field is an array of bounding capabilities that are kept for the process.
196
* **`inheritable`** (array of strings, OPTIONAL) the `inheritable` field is an array of inheritable capabilities that are kept for the process.
197
* **`permitted`** (array of strings, OPTIONAL) the `permitted` field is an array of permitted capabilities that are kept for the process.
198
* **`ambient`** (array of strings, OPTIONAL) the `ambient` field is an array of ambient capabilities that are kept for the process.
199
* **`noNewPrivileges`** (bool, OPTIONAL) setting `noNewPrivileges` to true prevents the process from gaining additional privileges.
200
As an example, the [`no_new_privs`][no-new-privs] article in the kernel documentation has information on how this is achieved using a `prctl` system call on Linux.
201
* **`oomScoreAdj`** *(int, OPTIONAL)* adjusts the oom-killer score in `[pid]/oom_score_adj` for the process's `[pid]` in a [proc pseudo-filesystem][procfs].
202
If `oomScoreAdj` is set, the runtime MUST set `oom_score_adj` to the given value.
203
If `oomScoreAdj` is not set, the runtime MUST NOT change the value of `oom_score_adj`.
204
205
This is a per-process setting, where as [`disableOOMKiller`](config-linux.md#disable-out-of-memory-killer) is scoped for a memory cgroup.
206
For more information on how these two settings work together, see [the memory cgroup documentation section 10. OOM Contol][cgroup-v1-memory_2].
207
* **`selinuxLabel`** (string, OPTIONAL) specifies the SELinux label for the process.
208
For more information about SELinux, see [SELinux documentation][selinux].
209
210
### <a name="configUser" />User
211
212
The user for the process is a platform-specific structure that allows specific control over which user the process runs as.
213
214
#### <a name="configPOSIXUser" />POSIX-platform User
215
216
For POSIX platforms the `user` structure has the following fields:
217
218
* **`uid`** (int, REQUIRED) specifies the user ID in the [container namespace](glossary.md#container-namespace).
219
* **`gid`** (int, REQUIRED) specifies the group ID in the [container namespace](glossary.md#container-namespace).
220
* **`additionalGids`** (array of ints, OPTIONAL) specifies additional group IDs in the [container namespace](glossary.md#container-namespace) to be added to the process.
221
222
_Note: symbolic name for uid and gid, such as uname and gname respectively, are left to upper levels to derive (i.e. `/etc/passwd` parsing, NSS, etc)_
223
224
### Example (Linux)
225
226
```json
227
"process": {
228
"terminal": true,
229
"consoleSize": {
230
"height": 25,
231
"width": 80
232
},
233
"user": {
234
"uid": 1,
235
"gid": 1,
236
"additionalGids": [5, 6]
237
},
238
"env": [
239
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
240
"TERM=xterm"
241
],
242
"cwd": "/root",
243
"args": [
244
"sh"
245
],
246
"apparmorProfile": "acme_secure_profile",
247
"selinuxLabel": "system_u:system_r:svirt_lxc_net_t:s0:c124,c675",
248
"noNewPrivileges": true,
249
"capabilities": {
250
"bounding": [
251
"CAP_AUDIT_WRITE",
252
"CAP_KILL",
253
"CAP_NET_BIND_SERVICE"
254
],
255
"permitted": [
256
"CAP_AUDIT_WRITE",
257
"CAP_KILL",
258
"CAP_NET_BIND_SERVICE"
259
],
260
"inheritable": [
261
"CAP_AUDIT_WRITE",
262
"CAP_KILL",
263
"CAP_NET_BIND_SERVICE"
264
],
265
"effective": [
266
"CAP_AUDIT_WRITE",
267
"CAP_KILL"
268
],
269
"ambient": [
270
"CAP_NET_BIND_SERVICE"
271
]
272
},
273
"rlimits": [
274
{
275
"type": "RLIMIT_NOFILE",
276
"hard": 1024,
277
"soft": 1024
278
}
279
]
280
}
281
```
282
### Example (Solaris)
283
284
```json
285
"process": {
286
"terminal": true,
287
"consoleSize": {
288
"height": 25,
289
"width": 80
290
},
291
"user": {
292
"uid": 1,
293
"gid": 1,
294
"additionalGids": [2, 8]
295
},
296
"env": [
297
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
298
"TERM=xterm"
299
],
300
"cwd": "/root",
301
"args": [
302
"/usr/bin/bash"
303
]
304
}
305
```
306
307
#### <a name="configWindowsUser" />Windows User
308
309
For Windows based systems the user structure has the following fields:
310
311
* **`username`** (string, OPTIONAL) specifies the user name for the process.
312
313
### Example (Windows)
314
315
```json
316
"process": {
317
"terminal": true,
318
"user": {
319
"username": "containeradministrator"
320
},
321
"env": [
322
"VARIABLE=1"
323
],
324
"cwd": "c:\\foo",
325
"args": [
326
"someapp.exe",
327
]
328
}
329
```
330
331
332
## <a name="configHostname" />Hostname
333
334
* **`hostname`** (string, OPTIONAL) specifies the container's hostname as seen by processes running inside the container.
335
On Linux, for example, this will change the hostname in the [container](glossary.md#container-namespace) [UTS namespace][uts-namespace.7].
336
Depending on your [namespace configuration](config-linux.md#namespaces), the container UTS namespace may be the [runtime](glossary.md#runtime-namespace) [UTS namespace][uts-namespace.7].
337
338
### Example
339
340
```json
341
"hostname": "mrsdalloway"
342
```
343
344
## <a name="configPlatformSpecificConfiguration" />Platform-specific configuration
345
346
* **`linux`** (object, OPTIONAL) [Linux-specific configuration](config-linux.md).
347
This MAY be set if the target platform of this spec is `linux`.
348
* **`windows`** (object, OPTIONAL) [Windows-specific configuration](config-windows.md).
349
This MUST be set if the target platform of this spec is `windows`.
350
* **`solaris`** (object, OPTIONAL) [Solaris-specific configuration](config-solaris.md).
351
This MAY be set if the target platform of this spec is `solaris`.
352
353
### Example (Linux)
354
355
```json
356
{
357
"linux": {
358
"namespaces": [
359
{
360
"type": "pid"
361
}
362
]
363
}
364
}
365
```
366
367
## <a name="configHooks" />POSIX-platform Hooks
368
369
For POSIX platforms, the configuration structure supports `hooks` for configuring custom actions related to the [lifecycle](runtime.md#lifecycle) of the container.
370
371
* **`hooks`** (object, OPTIONAL) MAY contain any of the following properties:
372
* **`prestart`** (array of objects, OPTIONAL) is an array of [pre-start hooks](#prestart).
373
Entries in the array contain the following properties:
374
* **`path`** (string, REQUIRED) with similar semantics to [IEEE Std 1003.1-2008 `execv`'s *path*][ieee-1003.1-2008-functions-exec].
375
This specification extends the IEEE standard in that **`path`** MUST be absolute.
376
* **`args`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2008 `execv`'s *argv*][ieee-1003.1-2008-functions-exec].
377
* **`env`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2008's `environ`][ieee-1003.1-2008-xbd-c8.1].
378
* **`timeout`** (int, OPTIONAL) is the number of seconds before aborting the hook.
379
If set, `timeout` MUST be greater than zero.
380
* **`poststart`** (array of objects, OPTIONAL) is an array of [post-start hooks](#poststart).
381
Entries in the array have the same schema as pre-start entries.
382
* **`poststop`** (array of objects, OPTIONAL) is an array of [post-stop hooks](#poststop).
383
Entries in the array have the same schema as pre-start entries.
384
385
Hooks allow users to specify programs to run before or after various lifecycle events.
386
Hooks MUST be called in the listed order.
387
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.
388
389
### <a name="configHooksPrestart" />Prestart
390
391
The pre-start hooks MUST be called after the [`start`](runtime.md#start) operation is called but [before the user-specified program command is executed](runtime.md#lifecycle).
392
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).
393
394
### <a name="configHooksPoststart" />Poststart
395
396
The post-start hooks MUST be called [after the user-specified process is executed](runtime.md#lifecycle) but before the [`start`](runtime.md#start) operation returns.
397
For example, this hook can notify the user that the container process is spawned.
398
399
### <a name="configHooksPoststop" />Poststop
400
401
The post-stop hooks MUST be called [after the container is deleted](runtime.md#lifecycle) but before the [`delete`](runtime.md#delete) operation returns.
402
Cleanup or debugging functions are examples of such a hook.
403
404
### Example
405
406
```json
407
"hooks": {
408
"prestart": [
409
{
410
"path": "/usr/bin/fix-mounts",
411
"args": ["fix-mounts", "arg1", "arg2"],
412
"env": [ "key1=value1"]
413
},
414
{
415
"path": "/usr/bin/setup-network"
416
}
417
],
418
"poststart": [
419
{
420
"path": "/usr/bin/notify-start",
421
"timeout": 5
422
}
423
],
424
"poststop": [
425
{
426
"path": "/usr/sbin/cleanup.sh",
427
"args": ["cleanup.sh", "-f"]
428
}
429
]
430
}
431
```
432
433
## <a name="configAnnotations" />Annotations
434
435
**`annotations`** (object, OPTIONAL) contains arbitrary metadata for the container.
436
This information MAY be structured or unstructured.
437
Annotations MUST be a key-value map.
438
If there are no annotations then this property MAY either be absent or an empty map.
439
440
Keys MUST be strings.
441
Keys MUST NOT be an empty string.
442
Keys SHOULD be named using a reverse domain notation - e.g. `com.example.myKey`.
443
Keys using the `org.opencontainers` namespace are reserved and MUST NOT be used by subsequent specifications.
444
Implementations that are reading/processing this configuration file MUST NOT generate an error if they encounter an unknown annotation key.
445
446
Values MUST be strings.
447
Values MAY be an empty string.
448
449
```json
450
"annotations": {
451
"com.example.gpu-cores": "2"
452
}
453
```
454
455
## <a name="configExtensibility" />Extensibility
456
457
Runtimes that are reading or processing this configuration file MUST NOT generate an error if they encounter an unknown property.
458
Instead they MUST ignore unknown properties.
459
460
## Valid values
461
462
Runtimes that are reading or processing this configuration file MUST generate an error when invalid or unsupported values are encountered.
463
Unless support for a valid value is explicitly required, runtimes MAY choose which subset of the valid values it will support.
464
465
## Configuration Schema Example
466
467
Here is a full example `config.json` for reference.
468
469
```json
470
{
471
"ociVersion": "0.5.0-dev",
472
"process": {
473
"terminal": true,
474
"user": {
475
"uid": 1,
476
"gid": 1,
477
"additionalGids": [
478
5,
479
6
480
]
481
},
482
"args": [
483
"sh"
484
],
485
"env": [
486
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
487
"TERM=xterm"
488
],
489
"cwd": "/",
490
"capabilities": {
491
"bounding": [
492
"CAP_AUDIT_WRITE",
493
"CAP_KILL",
494
"CAP_NET_BIND_SERVICE"
495
],
496
"permitted": [
497
"CAP_AUDIT_WRITE",
498
"CAP_KILL",
499
"CAP_NET_BIND_SERVICE"
500
],
501
"inheritable": [
502
"CAP_AUDIT_WRITE",
503
"CAP_KILL",
504
"CAP_NET_BIND_SERVICE"
505
],
506
"effective": [
507
"CAP_AUDIT_WRITE",
508
"CAP_KILL"
509
],
510
"ambient": [
511
"CAP_NET_BIND_SERVICE"
512
]
513
},
514
"rlimits": [
515
{
516
"type": "RLIMIT_CORE",
517
"hard": 1024,
518
"soft": 1024
519
},
520
{
521
"type": "RLIMIT_NOFILE",
522
"hard": 1024,
523
"soft": 1024
524
}
525
],
526
"apparmorProfile": "acme_secure_profile",
527
"oomScoreAdj": 100,
528
"selinuxLabel": "system_u:system_r:svirt_lxc_net_t:s0:c124,c675",
529
"noNewPrivileges": true
530
},
531
"root": {
532
"path": "rootfs",
533
"readonly": true
534
},
535
"hostname": "slartibartfast",
536
"mounts": [
537
{
538
"destination": "/proc",
539
"type": "proc",
540
"source": "proc"
541
},
542
{
543
"destination": "/dev",
544
"type": "tmpfs",
545
"source": "tmpfs",
546
"options": [
547
"nosuid",
548
"strictatime",
549
"mode=755",
550
"size=65536k"
551
]
552
},
553
{
554
"destination": "/dev/pts",
555
"type": "devpts",
556
"source": "devpts",
557
"options": [
558
"nosuid",
559
"noexec",
560
"newinstance",
561
"ptmxmode=0666",
562
"mode=0620",
563
"gid=5"
564
]
565
},
566
{
567
"destination": "/dev/shm",
568
"type": "tmpfs",
569
"source": "shm",
570
"options": [
571
"nosuid",
572
"noexec",
573
"nodev",
574
"mode=1777",
575
"size=65536k"
576
]
577
},
578
{
579
"destination": "/dev/mqueue",
580
"type": "mqueue",
581
"source": "mqueue",
582
"options": [
583
"nosuid",
584
"noexec",
585
"nodev"
586
]
587
},
588
{
589
"destination": "/sys",
590
"type": "sysfs",
591
"source": "sysfs",
592
"options": [
593
"nosuid",
594
"noexec",
595
"nodev"
596
]
597
},
598
{
599
"destination": "/sys/fs/cgroup",
600
"type": "cgroup",
601
"source": "cgroup",
602
"options": [
603
"nosuid",
604
"noexec",
605
"nodev",
606
"relatime",
607
"ro"
608
]
609
}
610
],
611
"hooks": {
612
"prestart": [
613
{
614
"path": "/usr/bin/fix-mounts",
615
"args": [
616
"fix-mounts",
617
"arg1",
618
"arg2"
619
],
620
"env": [
621
"key1=value1"
622
]
623
},
624
{
625
"path": "/usr/bin/setup-network"
626
}
627
],
628
"poststart": [
629
{
630
"path": "/usr/bin/notify-start",
631
"timeout": 5
632
}
633
],
634
"poststop": [
635
{
636
"path": "/usr/sbin/cleanup.sh",
637
"args": [
638
"cleanup.sh",
639
"-f"
640
]
641
}
642
]
643
},
644
"linux": {
645
"devices": [
646
{
647
"path": "/dev/fuse",
648
"type": "c",
649
"major": 10,
650
"minor": 229,
651
"fileMode": 438,
652
"uid": 0,
653
"gid": 0
654
},
655
{
656
"path": "/dev/sda",
657
"type": "b",
658
"major": 8,
659
"minor": 0,
660
"fileMode": 432,
661
"uid": 0,
662
"gid": 0
663
}
664
],
665
"uidMappings": [
666
{
667
"hostID": 1000,
668
"containerID": 0,
669
"size": 32000
670
}
671
],
672
"gidMappings": [
673
{
674
"hostID": 1000,
675
"containerID": 0,
676
"size": 32000
677
}
678
],
679
"sysctl": {
680
"net.ipv4.ip_forward": "1",
681
"net.core.somaxconn": "256"
682
},
683
"cgroupsPath": "/myRuntime/myContainer",
684
"resources": {
685
"network": {
686
"classID": 1048577,
687
"priorities": [
688
{
689
"name": "eth0",
690
"priority": 500
691
},
692
{
693
"name": "eth1",
694
"priority": 1000
695
}
696
]
697
},
698
"pids": {
699
"limit": 32771
700
},
701
"hugepageLimits": [
702
{
703
"pageSize": "2MB",
704
"limit": 9223372036854772000
705
}
706
],
707
"memory": {
708
"limit": 536870912,
709
"reservation": 536870912,
710
"swap": 536870912,
711
"kernel": -1,
712
"kernelTCP": -1,
713
"swappiness": 0
714
},
715
"cpu": {
716
"shares": 1024,
717
"quota": 1000000,
718
"period": 500000,
719
"realtimeRuntime": 950000,
720
"realtimePeriod": 1000000,
721
"cpus": "2-3",
722
"mems": "0-7"
723
},
724
"disableOOMKiller": false,
725
"devices": [
726
{
727
"allow": false,
728
"access": "rwm"
729
},
730
{
731
"allow": true,
732
"type": "c",
733
"major": 10,
734
"minor": 229,
735
"access": "rw"
736
},
737
{
738
"allow": true,
739
"type": "b",
740
"major": 8,
741
"minor": 0,
742
"access": "r"
743
}
744
],
745
"blockIO": {
746
"weight": 10,
747
"leafWeight": 10,
748
"weightDevice": [
749
{
750
"major": 8,
751
"minor": 0,
752
"weight": 500,
753
"leafWeight": 300
754
},
755
{
756
"major": 8,
757
"minor": 16,
758
"weight": 500
759
}
760
],
761
"throttleReadBpsDevice": [
762
{
763
"major": 8,
764
"minor": 0,
765
"rate": 600
766
}
767
],
768
"throttleWriteIOPSDevice": [
769
{
770
"major": 8,
771
"minor": 16,
772
"rate": 300
773
}
774
]
775
}
776
},
777
"rootfsPropagation": "slave",
778
"seccomp": {
779
"defaultAction": "SCMP_ACT_ALLOW",
780
"architectures": [
781
"SCMP_ARCH_X86",
782
"SCMP_ARCH_X32"
783
],
784
"syscalls": [
785
{
786
"names": [
787
"getcwd",
788
"chmod"
789
],
790
"action": "SCMP_ACT_ERRNO"
791
}
792
]
793
},
794
"namespaces": [
795
{
796
"type": "pid"
797
},
798
{
799
"type": "network"
800
},
801
{
802
"type": "ipc"
803
},
804
{
805
"type": "uts"
806
},
807
{
808
"type": "mount"
809
},
810
{
811
"type": "user"
812
},
813
{
814
"type": "cgroup"
815
}
816
],
817
"maskedPaths": [
818
"/proc/kcore",
819
"/proc/latency_stats",
820
"/proc/timer_stats",
821
"/proc/sched_debug"
822
],
823
"readonlyPaths": [
824
"/proc/asound",
825
"/proc/bus",
826
"/proc/fs",
827
"/proc/irq",
828
"/proc/sys",
829
"/proc/sysrq-trigger"
830
],
831
"mountLabel": "system_u:object_r:svirt_sandbox_file_t:s0:c715,c811"
832
},
833
"annotations": {
834
"com.example.key1": "value1",
835
"com.example.key2": "value2"
836
}
837
}
838
```
839
840
841
[apparmor]: https://wiki.ubuntu.com/AppArmor
842
[cgroup-v1-memory_2]: https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
843
[selinux]:http://selinuxproject.org/page/Main_Page
844
[no-new-privs]: https://www.kernel.org/doc/Documentation/prctl/no_new_privs.txt
845
[procfs_2]: https://www.kernel.org/doc/Documentation/filesystems/proc.txt
846
[semver-v2.0.0]: http://semver.org/spec/v2.0.0.html
847
[ieee-1003.1-2008-xbd-c8.1]: http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_01
848
[ieee-1003.1-2008-xsh-exec]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html
849
[naming-a-volume]: https://aka.ms/nb3hqb
850
851
[capabilities.7]: http://man7.org/linux/man-pages/man7/capabilities.7.html
852
[mount.2]: http://man7.org/linux/man-pages/man2/mount.2.html
853
[mount.8]: http://man7.org/linux/man-pages/man8/mount.8.html
854
[mount.8-filesystem-independent]: http://man7.org/linux/man-pages/man8/mount.8.html#FILESYSTEM-INDEPENDENT_MOUNT%20OPTIONS
855
[mount.8-filesystem-specific]: http://man7.org/linux/man-pages/man8/mount.8.html#FILESYSTEM-SPECIFIC_MOUNT%20OPTIONS
856
[getrlimit.2]: http://man7.org/linux/man-pages/man2/getrlimit.2.html
857
[getrlimit.3]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/getrlimit.html
858
[stdin.3]: http://man7.org/linux/man-pages/man3/stdin.3.html
859
[uts-namespace.7]: http://man7.org/linux/man-pages/man7/namespaces.7.html
860
[zonecfg.1m]: http://docs.oracle.com/cd/E86824_01/html/E54764/zonecfg-1m.html