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