Debian Codegraph @

config.md

raw symbols SCIP
1 # <a name="configuration" />Configuration
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 Initiative Runtime Specification with which the bundle complies.
18 The Open Container Initiative 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 * On Windows, `path` MUST be a [volume GUID path][naming-a-volume].
37 * On POSIX platforms, `path` is either an absolute path or a relative path to the bundle.
38 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`.
39 The value SHOULD be the conventional `rootfs`.
40
41 A directory MUST exist at the path declared by the field.
42
43 * **`readonly`** (bool, OPTIONAL) If true then the root filesystem MUST be read-only inside the container, defaults to false.
44 * On Windows, this field MUST be omitted or false.
45
46 ### Example (POSIX platforms)
47
48 ```json
49 "root": {
50 "path": "rootfs",
51 "readonly": true
52 }
53 ```
54
55 ### Example (Windows)
56
57 ```json
58 "root": {
59 "path": "\\\\?\\Volume{ec84d99e-3f02-11e7-ac6c-00155d7682cf}\\"
60 }
61 ```
62
63 ## <a name="configMounts" />Mounts
64
65 **`mounts`** (array of objects, OPTIONAL) specifies additional mounts beyond [`root`](#root).
66 The runtime MUST mount entries in the listed order.
67 For Linux, the parameters are as documented in [mount(2)][mount.2] system call man page.
68 For Solaris, the mount entry corresponds to the 'fs' resource in the [zonecfg(1M)][zonecfg.1m] man page.
69
70 * **`destination`** (string, REQUIRED) Destination of mount point: path inside container.
71 * Linux: This value SHOULD be an absolute path.
72 For compatibility with old tools and configurations, it MAY be a relative path, in which case it MUST be interpreted as relative to "/".
73 Relative paths are **deprecated**.
74 * Windows: This value MUST be an absolute path.
75 One mount destination MUST NOT be nested within another mount (e.g., c:\\foo and c:\\foo\\bar).
76 * Solaris: This value MUST be an absolute path.
77 Corresponds to "dir" of the fs resource in [zonecfg(1M)][zonecfg.1m].
78 * For all other platforms: This value MUST be an absolute path.
79 * **`source`** (string, OPTIONAL) A device name, but can also be a file or directory name for bind mounts or a dummy.
80 Path values for bind mounts are either absolute or relative to the bundle.
81 A mount is a bind mount if it has either `bind` or `rbind` in the options.
82 * Windows: a local directory on the filesystem of the container host. UNC paths and mapped drives are not supported.
83 * Solaris: corresponds to "special" of the fs resource in [zonecfg(1M)][zonecfg.1m].
84 * **`options`** (array of strings, OPTIONAL) Mount options of the filesystem to be used.
85 * Linux: See [Linux mount options](#configLinuxMountOptions) below.
86 * Solaris: corresponds to "options" of the fs resource in [zonecfg(1M)][zonecfg.1m].
87 * Windows: runtimes MUST support `ro`, mounting the filesystem read-only when `ro` is given.
88
89 ### <a name="configLinuxMountOptions" />Linux mount options
90
91 Runtimes MUST/SHOULD/MAY implement the following option strings for Linux:
92
93 Option name | Requirement | Description
94 ------------------|-------------|-----------------------------------------------------
95 `async` | MUST | [^1]
96 `atime` | MUST | [^1]
97 `bind` | MUST | Bind mount [^2]
98 `defaults` | MUST | [^1]
99 `dev` | MUST | [^1]
100 `diratime` | MUST | [^1]
101 `dirsync` | MUST | [^1]
102 `exec` | MUST | [^1]
103 `iversion` | MUST | [^1]
104 `lazytime` | MUST | [^1]
105 `loud` | MUST | [^1]
106 `mand` | MAY | [^1] (Deprecated in kernel 5.15, util-linux 2.38)
107 `noatime` | MUST | [^1]
108 `nodev` | MUST | [^1]
109 `nodiratime` | MUST | [^1]
110 `noexec` | MUST | [^1]
111 `noiversion` | MUST | [^1]
112 `nolazytime` | MUST | [^1]
113 `nomand` | MAY | [^1]
114 `norelatime` | MUST | [^1]
115 `nostrictatime` | MUST | [^1]
116 `nosuid` | MUST | [^1]
117 `nosymfollow` | SHOULD | [^1] (Introduced in kernel 5.10, util-linux 2.38)
118 `private` | MUST | Bind mount propagation [^2]
119 `ratime` | SHOULD | Recursive `atime` [^3]
120 `rbind` | MUST | Recursive bind mount [^2]
121 `rdev` | SHOULD | Recursive `dev` [^3]
122 `rdiratime` | SHOULD | Recursive `diratime` [^3]
123 `relatime` | MUST | [^1]
124 `remount` | MUST | [^1]
125 `rexec` | SHOULD | Recursive `dev` [^3]
126 `rnoatime` | SHOULD | Recursive `noatime` [^3]
127 `rnodiratime` | SHOULD | Recursive `nodiratime` [^3]
128 `rnoexec` | SHOULD | Recursive `noexec` [^3]
129 `rnorelatime` | SHOULD | Recursive `norelatime` [^3]
130 `rnostrictatime` | SHOULD | Recursive `nostrictatime` [^3]
131 `rnosuid` | SHOULD | Recursive `nosuid` [^3]
132 `rnosymfollow` | SHOULD | Recursive `nosymfollow` [^3]
133 `ro` | MUST | [^1]
134 `rprivate` | MUST | Bind mount propagation [^2]
135 `rrelatime ` | SHOULD | Recursive `relatime` [^3]
136 `rro` | SHOULD | Recursive `ro` [^3]
137 `rrw` | SHOULD | Recursive `rw` [^3]
138 `rshared` | MUST | Bind mount propagation [^2]
139 `rslave` | MUST | Bind mount propagation [^2]
140 `rstrictatime` | SHOULD | Recursive `strictatime` [^3]
141 `rsuid` | SHOULD | Recursive `suid` [^3]
142 `rsymfollow` | SHOULD | Recursive `symfollow` [^3]
143 `runbindable` | MUST | Bind mount propagation [^2]
144 `rw` | MUST | [^1]
145 `shared` | MUST | [^1]
146 `silent` | MUST | [^1]
147 `slave` | MUST | Bind mount propagation [^2]
148 `strictatime` | MUST | [^1]
149 `suid` | MUST | [^1]
150 `symfollow` | SHOULD | Opposite of `nosymfollow`
151 `sync` | MUST | [^1]
152 `tmpcopyup` | MAY | copy up the contents to a tmpfs
153 `unbindable` | MUST | Bind mount propagation [^2]
154 `idmap` | SHOULD | Indicates that the mount MUST have an idmapping applied. This option SHOULD NOT be passed to the underlying [`mount(2)`][mount.2] call. If `uidMappings` or `gidMappings` are specified for the mount, the runtime MUST use those values for the mount's mapping. If they are not specified, the runtime MAY use the container's user namespace mapping, otherwise an [error MUST be returned](runtime.md#errors). If there are no `uidMappings` and `gidMappings` specified and the container isn't using user namespaces, an [error MUST be returned](runtime.md#errors). This SHOULD be implemented using [`mount_setattr(MOUNT_ATTR_IDMAP)`][mount_setattr.2], available since Linux 5.12.
155 `ridmap` | SHOULD | Indicates that the mount MUST have an idmapping applied, and the mapping is applied recursively [^3]. This option SHOULD NOT be passed to the underlying [`mount(2)`][mount.2] call. If `uidMappings` or `gidMappings` are specified for the mount, the runtime MUST use those values for the mount's mapping. If they are not specified, the runtime MAY use the container's user namespace mapping, otherwise an [error MUST be returned](runtime.md#errors). If there are no `uidMappings` and `gidMappings` specified and the container isn't using user namespaces, an [error MUST be returned](runtime.md#errors). This SHOULD be implemented using [`mount_setattr(MOUNT_ATTR_IDMAP)`][mount_setattr.2], available since Linux 5.12.
156
157 [^1]: Corresponds to [`mount(8)` (filesystem-independent)][mount.8-filesystem-independent].
158 [^2]: Corresponds to [bind mounts and shared subtrees][mount-bind].
159 [^3]: These `AT_RECURSIVE` options need kernel 5.12 or later. See [`mount_setattr(2)`][mount_setattr.2]
160
161 The "MUST" options correspond to [`mount(8)`][mount.8].
162
163 Runtimes MAY also implement custom option strings that are not listed in the table above.
164 If a custom option string is already recognized by [`mount(8)`][mount.8], the runtime SHOULD follow the behavior of [`mount(8)`][mount.8].
165
166 Runtimes SHOULD treat unknown options as [filesystem-specific ones][mount.8-filesystem-specific])
167 and pass those as a comma-separated string to the fifth (`const void *data`) argument of [`mount(2)`][mount.2].
168
169 ### Example (Windows)
170
171 ```json
172 "mounts": [
173 {
174 "destination": "C:\\folder-inside-container",
175 "source": "C:\\folder-on-host",
176 "options": ["ro"]
177 }
178 ]
179 ```
180
181 ### <a name="configPOSIXMounts" />POSIX-platform Mounts
182
183 For POSIX platforms the `mounts` structure has the following fields:
184
185 * **`type`** (string, OPTIONAL) The type of the filesystem to be mounted.
186 * Linux: filesystem types supported by the kernel as listed in */proc/filesystems* (e.g., "minix", "ext2", "ext3", "jfs", "xfs", "reiserfs", "msdos", "proc", "nfs", "iso9660"). For bind mounts (when `options` include either `bind` or `rbind`), the type is a dummy, often "none" (not listed in */proc/filesystems*).
187 * Solaris: corresponds to "type" of the fs resource in [zonecfg(1M)][zonecfg.1m].
188 * **`uidMappings`** (array of type LinuxIDMapping, OPTIONAL) The mapping to convert UIDs from the source file system to the destination mount point.
189 This SHOULD be implemented using [`mount_setattr(MOUNT_ATTR_IDMAP)`][mount_setattr.2], available since Linux 5.12.
190 If specified, the `options` field of the `mounts` structure SHOULD contain either `idmap` or `ridmap` to specify whether the mapping should be applied recursively for `rbind` mounts, as well as to ensure that older runtimes will not silently ignore this field.
191 The format is the same as [user namespace mappings](config-linux.md#user-namespace-mappings).
192 If specified, it MUST be specified along with `gidMappings`.
193 * **`gidMappings`** (array of type LinuxIDMapping, OPTIONAL) The mapping to convert GIDs from the source file system to the destination mount point.
194 This SHOULD be implemented using [`mount_setattr(MOUNT_ATTR_IDMAP)`][mount_setattr.2], available since Linux 5.12.
195 If specified, the `options` field of the `mounts` structure SHOULD contain either `idmap` or `ridmap` to specify whether the mapping should be applied recursively for `rbind` mounts, as well as to ensure that older runtimes will not silently ignore this field.
196 For more details see `uidMappings`.
197 If specified, it MUST be specified along with `uidMappings`.
198
199
200 ### Example (Linux)
201
202 ```json
203 "mounts": [
204 {
205 "destination": "/tmp",
206 "type": "tmpfs",
207 "source": "tmpfs",
208 "options": ["nosuid","strictatime","mode=755","size=65536k"]
209 },
210 {
211 "destination": "/data",
212 "type": "none",
213 "source": "/volumes/testing",
214 "options": ["rbind","rw"]
215 }
216 ]
217 ```
218
219 ### Example (Solaris)
220
221 ```json
222 "mounts": [
223 {
224 "destination": "/opt/local",
225 "type": "lofs",
226 "source": "/usr/local",
227 "options": ["ro","nodevices"]
228 },
229 {
230 "destination": "/opt/sfw",
231 "type": "lofs",
232 "source": "/opt/sfw"
233 }
234 ]
235 ```
236
237 ## <a name="configProcess" />Process
238
239 **`process`** (object, OPTIONAL) specifies the container process.
240 This property is REQUIRED when [`start`](runtime.md#start) is called.
241
242 * **`terminal`** (bool, OPTIONAL) specifies whether a terminal is attached to the process, defaults to false.
243 As an example, if set to true on Linux a pseudoterminal pair is allocated for the process and the pseudoterminal pty is duplicated on the process's [standard streams][stdin.3].
244 * **`consoleSize`** (object, OPTIONAL) specifies the console size in characters of the terminal.
245 Runtimes MUST ignore `consoleSize` if `terminal` is `false` or unset.
246 * **`height`** (uint, REQUIRED)
247 * **`width`** (uint, REQUIRED)
248 * **`cwd`** (string, REQUIRED) is the working directory that will be set for the executable.
249 This value MUST be an absolute path.
250 * **`env`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2008's `environ`][ieee-1003.1-2008-xbd-c8.1].
251 * **`args`** (array of strings, OPTIONAL) with similar semantics to [IEEE Std 1003.1-2008 `execvp`'s *argv*][ieee-1003.1-2008-functions-exec].
252 This specification extends the IEEE standard in that at least one entry is REQUIRED (non-Windows), and that entry is used with the same semantics as `execvp`'s *file*. This field is OPTIONAL on Windows, and `commandLine` is REQUIRED if this field is omitted.
253 * **`commandLine`** (string, OPTIONAL) specifies the full command line to be executed on Windows.
254 This is the preferred means of supplying the command line on Windows. If omitted, the runtime will fall back to escaping and concatenating fields from `args` before making the system call into Windows.
255
256
257 ### <a name="configPOSIXProcess" />POSIX process
258
259 For systems that support POSIX rlimits (for example Linux and Solaris), the `process` object supports the following process-specific properties:
260
261 * **`rlimits`** (array of objects, OPTIONAL) allows setting resource limits for the process.
262 Each entry has the following structure:
263
264 * **`type`** (string, REQUIRED) the platform resource being limited.
265 * Linux: valid values are defined in the [`getrlimit(2)`][getrlimit.2] man page, such as `RLIMIT_MSGQUEUE`.
266 * Solaris: valid values are defined in the [`getrlimit(3)`][getrlimit.3] man page, such as `RLIMIT_CORE`.
267
268 The runtime MUST [generate an error](runtime.md#errors) for any values which cannot be mapped to a relevant kernel interface.
269 For each entry in `rlimits`, a [`getrlimit(3)`][getrlimit.3] on `type` MUST succeed.
270 For the following properties, `rlim` refers to the status returned by the `getrlimit(3)` call.
271
272 * **`soft`** (uint64, REQUIRED) the value of the limit enforced for the corresponding resource.
273 `rlim.rlim_cur` MUST match the configured value.
274 * **`hard`** (uint64, REQUIRED) the ceiling for the soft limit that could be set by an unprivileged process.
275 `rlim.rlim_max` MUST match the configured value.
276 Only a privileged process (e.g. one with the `CAP_SYS_RESOURCE` capability) can raise a hard limit.
277
278 If `rlimits` contains duplicated entries with same `type`, the runtime MUST [generate an error](runtime.md#errors).
279
280 ### <a name="configLinuxProcess" />Linux Process
281
282 For Linux-based systems, the `process` object supports the following process-specific properties.
283
284 * **`apparmorProfile`** (string, OPTIONAL) specifies the name of the AppArmor profile for the process.
285 For more information about AppArmor, see [AppArmor documentation][apparmor].
286 * **`capabilities`** (object, OPTIONAL) is an object containing arrays that specifies the sets of capabilities for the process.
287 Valid values are defined in the [capabilities(7)][capabilities.7] man page, such as `CAP_CHOWN`.
288 Any value which cannot be mapped to a relevant kernel interface, or cannot
289 be granted otherwise MUST be [logged as a warning](runtime.md#warnings) by
290 the runtime. Runtimes SHOULD NOT fail if the container configuration requests
291 capabilities that cannot be granted, for example, if the runtime operates in
292 a restricted environment with a limited set of capabilities.
293 `capabilities` contains the following properties:
294
295 * **`effective`** (array of strings, OPTIONAL) the `effective` field is an array of effective capabilities that are kept for the process.
296 * **`bounding`** (array of strings, OPTIONAL) the `bounding` field is an array of bounding capabilities that are kept for the process.
297 * **`inheritable`** (array of strings, OPTIONAL) the `inheritable` field is an array of inheritable capabilities that are kept for the process.
298 * **`permitted`** (array of strings, OPTIONAL) the `permitted` field is an array of permitted capabilities that are kept for the process.
299 * **`ambient`** (array of strings, OPTIONAL) the `ambient` field is an array of ambient capabilities that are kept for the process.
300 * **`noNewPrivileges`** (bool, OPTIONAL) setting `noNewPrivileges` to true prevents the process from gaining additional privileges.
301 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.
302 * **`oomScoreAdj`** *(int, OPTIONAL)* adjusts the oom-killer score in `[pid]/oom_score_adj` for the process's `[pid]` in a [proc pseudo-filesystem][proc_2].
303 If `oomScoreAdj` is set, the runtime MUST set `oom_score_adj` to the given value.
304 If `oomScoreAdj` is not set, the runtime MUST NOT change the value of `oom_score_adj`.
305
306 This is a per-process setting, where as [`disableOOMKiller`](config-linux.md#memory) is scoped for a memory cgroup.
307 For more information on how these two settings work together, see [the memory cgroup documentation section 10. OOM Contol][cgroup-v1-memory_2].
308 * **`scheduler`** (object, OPTIONAL) is an object describing the scheduler properties for the process. The `scheduler` contains the following properties:
309
310 * **`policy`** (string, REQUIRED) represents the scheduling policy. A valid list of values is:
311
312 * `SCHED_OTHER`
313 * `SCHED_FIFO`
314 * `SCHED_RR`
315 * `SCHED_BATCH`
316 * `SCHED_ISO`
317 * `SCHED_IDLE`
318 * `SCHED_DEADLINE`
319
320 * **`nice`** (int32, OPTIONAL) is the nice value for the process, affecting its priority. A lower nice value corresponds to a higher priority. If not set, the runtime must use the value 0.
321 * **`priority`** (int32, OPTIONAL) represents the static priority of the process, used by real-time policies like SCHED_FIFO and SCHED_RR. If not set, the runtime must use the value 0.
322 * **`flags`** (array of strings, OPTIONAL) is an array of strings representing scheduling flags. A valid list of values is:
323
324 * `SCHED_FLAG_RESET_ON_FORK`
325 * `SCHED_FLAG_RECLAIM`
326 * `SCHED_FLAG_DL_OVERRUN`
327 * `SCHED_FLAG_KEEP_POLICY`
328 * `SCHED_FLAG_KEEP_PARAMS`
329 * `SCHED_FLAG_UTIL_CLAMP_MIN`
330 * `SCHED_FLAG_UTIL_CLAMP_MAX`
331
332 * **`runtime`** (uint64, OPTIONAL) represents the amount of time in nanoseconds during which the process is allowed to run in a given period, used by the deadline scheduler. If not set, the runtime must use the value 0.
333 * **`deadline`** (uint64, OPTIONAL) represents the absolute deadline for the process to complete its execution, used by the deadline scheduler. If not set, the runtime must use the value 0.
334 * **`period`** (uint64, OPTIONAL) represents the length of the period in nanoseconds used for determining the process runtime, used by the deadline scheduler. If not set, the runtime must use the value 0.
335 * **`selinuxLabel`** (string, OPTIONAL) specifies the SELinux label for the process.
336 For more information about SELinux, see [SELinux documentation][selinux].
337 * **`ioPriority`** (object, OPTIONAL) configures the I/O priority settings for the container's processes within the process group.
338 The I/O priority settings will be automatically applied to the entire process group, affecting all processes within the container.
339 The following properties are available:
340
341 * **`class`** (string, REQUIRED) specifies the I/O scheduling class. Possible values are `IOPRIO_CLASS_RT`, `IOPRIO_CLASS_BE`, and `IOPRIO_CLASS_IDLE`.
342 * **`priority`** (int, REQUIRED) specifies the priority level within the class. The value should be an integer ranging from 0 (highest) to 7 (lowest).
343 * **`execCPUAffinity`** (object, OPTIONAL) specifies CPU affinity used to execute the process.
344 This setting is not applicable to the container's init process.
345 The following properties are available:
346 * **`initial`** (string, OPTIONAL) is a list of CPUs a runtime parent
347 process to be run on initially, before the transition to container's
348 cgroup. This is a a comma-separated list, with dashes to represent
349 ranges. For example, `0-3,7` represents CPUs 0,1,2,3, and 7.
350 * **`final`** (string, OPTIONAL) is a list of CPUs the process will be run
351 on after the transition to container's cgroup. The format is the same as
352 for `initial`. If omitted or empty, runtime SHOULD NOT change process'
353 CPU affinity after the process is moved to container's cgroup, and the
354 final affinity is determined by the Linux kernel.
355
356 ### <a name="configZOSProcess" />z/OS Process
357
358 For z/OS-based systems, the `process` object supports the following process-specific properties.
359
360 * **`noNewPrivileges`** (bool, OPTIONAL) setting `noNewPrivileges` to true prevents the process from gaining additional privileges.
361
362 ### <a name="configUser" />User
363
364 The user for the process is a platform-specific structure that allows specific control over which user the process runs as.
365
366 #### <a name="configPOSIXUser" />POSIX-platform User
367
368 For POSIX platforms the `user` structure has the following fields:
369
370 * **`uid`** (int, REQUIRED) specifies the user ID in the [container namespace](glossary.md#container-namespace).
371 * **`gid`** (int, REQUIRED) specifies the group ID in the [container namespace](glossary.md#container-namespace).
372 * **`umask`** (int, OPTIONAL) specifies the [umask][umask_2] of the user. If unspecified, the umask should not be changed from the calling process' umask.
373 * **`additionalGids`** (array of ints, OPTIONAL) specifies additional group IDs in the [container namespace](glossary.md#container-namespace) to be added to the process.
374
375 _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)_
376
377 ### Example (Linux)
378
379 ```json
380 "process": {
381 "terminal": true,
382 "consoleSize": {
383 "height": 25,
384 "width": 80
385 },
386 "user": {
387 "uid": 1,
388 "gid": 1,
389 "umask": 63,
390 "additionalGids": [5, 6]
391 },
392 "env": [
393 "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
394 "TERM=xterm"
395 ],
396 "cwd": "/root",
397 "args": [
398 "sh"
399 ],
400 "apparmorProfile": "acme_secure_profile",
401 "selinuxLabel": "system_u:system_r:svirt_lxc_net_t:s0:c124,c675",
402 "ioPriority": {
403 "class": "IOPRIO_CLASS_IDLE",
404 "priority": 4
405 },
406 "noNewPrivileges": true,
407 "capabilities": {
408 "bounding": [
409 "CAP_AUDIT_WRITE",
410 "CAP_KILL",
411 "CAP_NET_BIND_SERVICE"
412 ],
413 "permitted": [
414 "CAP_AUDIT_WRITE",
415 "CAP_KILL",
416 "CAP_NET_BIND_SERVICE"
417 ],
418 "inheritable": [
419 "CAP_AUDIT_WRITE",
420 "CAP_KILL",
421 "CAP_NET_BIND_SERVICE"
422 ],
423 "effective": [
424 "CAP_AUDIT_WRITE",
425 "CAP_KILL"
426 ],
427 "ambient": [
428 "CAP_NET_BIND_SERVICE"
429 ]
430 },
431 "rlimits": [
432 {
433 "type": "RLIMIT_NOFILE",
434 "hard": 1024,
435 "soft": 1024
436 }
437 ],
438 "execCPUAffinity": {
439 "initial": "7",
440 "final": "0-3,7"
441 }
442 }
443 ```
444 ### Example (Solaris)
445
446 ```json
447 "process": {
448 "terminal": true,
449 "consoleSize": {
450 "height": 25,
451 "width": 80
452 },
453 "user": {
454 "uid": 1,
455 "gid": 1,
456 "umask": 7,
457 "additionalGids": [2, 8]
458 },
459 "env": [
460 "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
461 "TERM=xterm"
462 ],
463 "cwd": "/root",
464 "args": [
465 "/usr/bin/bash"
466 ]
467 }
468 ```
469
470 #### <a name="configWindowsUser" />Windows User
471
472 For Windows based systems the user structure has the following fields:
473
474 * **`username`** (string, OPTIONAL) specifies the user name for the process.
475
476 ### Example (Windows)
477
478 ```json
479 "process": {
480 "terminal": true,
481 "user": {
482 "username": "containeradministrator"
483 },
484 "env": [
485 "VARIABLE=1"
486 ],
487 "cwd": "c:\\foo",
488 "args": [
489 "someapp.exe",
490 ]
491 }
492 ```
493
494
495 ## <a name="configHostname" />Hostname
496
497 * **`hostname`** (string, OPTIONAL) specifies the container's hostname as seen by processes running inside the container.
498 On Linux, for example, this will change the hostname in the [container](glossary.md#container-namespace) [UTS namespace][uts-namespace.7].
499 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].
500
501 ### Example
502
503 ```json
504 "hostname": "mrsdalloway"
505 ```
506
507 ## <a name="configDomainname" />Domainname
508
509 * **`domainname`** (string, OPTIONAL) specifies the container's domainname as seen by processes running inside the container.
510 On Linux, for example, this will change the domainname in the [container](glossary.md#container-namespace) [UTS namespace][uts-namespace.7].
511 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].
512
513 ### Example
514
515 ```json
516 "domainname": "foobarbaz.test"
517 ```
518
519 ## <a name="configPlatformSpecificConfiguration" />Platform-specific configuration
520
521 * **`linux`** (object, OPTIONAL) [Linux-specific configuration](config-linux.md).
522 This MAY be set if the target platform of this spec is `linux`.
523 * **`windows`** (object, OPTIONAL) [Windows-specific configuration](config-windows.md).
524 This MUST be set if the target platform of this spec is `windows`.
525 * **`solaris`** (object, OPTIONAL) [Solaris-specific configuration](config-solaris.md).
526 This MAY be set if the target platform of this spec is `solaris`.
527 * **`vm`** (object, OPTIONAL) [Virtual-machine-specific configuration](config-vm.md).
528 This MAY be set if the target platform and architecture of this spec support hardware virtualization.
529 * **`zos`** (object, OPTIONAL) [z/OS-specific configuration](config-zos.md).
530 This MAY be set if the target platform of this spec is `zos`.
531
532 ### Example (Linux)
533
534 ```json
535 {
536 "linux": {
537 "namespaces": [
538 {
539 "type": "pid"
540 }
541 ]
542 }
543 }
544 ```
545
546 ## <a name="configHooks" />POSIX-platform Hooks
547
548 For POSIX platforms, the configuration structure supports `hooks` for configuring custom actions related to the [lifecycle](runtime.md#lifecycle) of the container.
549
550 * **`hooks`** (object, OPTIONAL) MAY contain any of the following properties:
551 * **`prestart`** (array of objects, OPTIONAL, **DEPRECATED**) is an array of [`prestart` hooks](#prestart).
552 * Entries in the array contain the following properties:
553 * **`path`** (string, REQUIRED) with similar semantics to [IEEE Std 1003.1-2008 `execv`'s *path*][ieee-1003.1-2008-functions-exec].
554 This specification extends the IEEE standard in that **`path`** MUST be absolute.
555 * **`args`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2008 `execv`'s *argv*][ieee-1003.1-2008-functions-exec].
556 * **`env`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2008's `environ`][ieee-1003.1-2008-xbd-c8.1].
557 * **`timeout`** (int, OPTIONAL) is the number of seconds before aborting the hook.
558 If set, `timeout` MUST be greater than zero.
559 * The value of `path` MUST resolve in the [runtime namespace](glossary.md#runtime-namespace).
560 * The `prestart` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace).
561 * **`createRuntime`** (array of objects, OPTIONAL) is an array of [`createRuntime` hooks](#createRuntime-hooks).
562 * Entries in the array contain the following properties (the entries are identical to the entries in the deprecated `prestart` hooks):
563 * **`path`** (string, REQUIRED) with similar semantics to [IEEE Std 1003.1-2008 `execv`'s *path*][ieee-1003.1-2008-functions-exec].
564 This specification extends the IEEE standard in that **`path`** MUST be absolute.
565 * **`args`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2008 `execv`'s *argv*][ieee-1003.1-2008-functions-exec].
566 * **`env`** (array of strings, OPTIONAL) with the same semantics as [IEEE Std 1003.1-2008's `environ`][ieee-1003.1-2008-xbd-c8.1].
567 * **`timeout`** (int, OPTIONAL) is the number of seconds before aborting the hook.
568 If set, `timeout` MUST be greater than zero.
569 * The value of `path` MUST resolve in the [runtime namespace](glossary.md#runtime-namespace).
570 * The `createRuntime` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace).
571 * **`createContainer`** (array of objects, OPTIONAL) is an array of [`createContainer` hooks](#createContainer-hooks).
572 * Entries in the array have the same schema as `createRuntime` entries.
573 * The value of `path` MUST resolve in the [runtime namespace](glossary.md#runtime-namespace).
574 * The `createContainer` hooks MUST be executed in the [container namespace](glossary.md#container-namespace).
575 * **`startContainer`** (array of objects, OPTIONAL) is an array of [`startContainer` hooks](#startContainer-hooks).
576 * Entries in the array have the same schema as `createRuntime` entries.
577 * The value of `path` MUST resolve in the [container namespace](glossary.md#container-namespace).
578 * The `startContainer` hooks MUST be executed in the [container namespace](glossary.md#container-namespace).
579 * **`poststart`** (array of objects, OPTIONAL) is an array of [`poststart` hooks](#poststart).
580 * Entries in the array have the same schema as `createRuntime` entries.
581 * The value of `path` MUST resolve in the [runtime namespace](glossary.md#runtime-namespace).
582 * The `poststart` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace).
583 * **`poststop`** (array of objects, OPTIONAL) is an array of [`poststop` hooks](#poststop).
584 * Entries in the array have the same schema as `createRuntime` entries.
585 * The value of `path` MUST resolve in the [runtime namespace](glossary.md#runtime-namespace).
586 * The `poststop` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace).
587
588 Hooks allow users to specify programs to run before or after various lifecycle events.
589 Hooks MUST be called in the listed order.
590 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.
591
592 ### <a name="configHooksPrestart" />Prestart
593
594 The `prestart` hooks MUST be called as part of the [`create`](runtime.md#create) operation after the runtime environment has been created (according to the configuration in config.json) but before the `pivot_root` or any equivalent operation has been executed.
595 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).
596 The `prestart` hooks MUST be called before the `createRuntime` hooks.
597
598 Note: `prestart` hooks were deprecated in favor of `createRuntime`, `createContainer` and `startContainer` hooks, which allow more granular hook control during the create and start phase.
599
600 The `prestart` hooks' path MUST resolve in the [runtime namespace](glossary.md#runtime-namespace).
601 The `prestart` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace).
602
603 ### <a name="configHooksCreateRuntime" />CreateRuntime Hooks
604
605 The `createRuntime` hooks MUST be called as part of the [`create`](runtime.md#create) operation after the runtime environment has been created (according to the configuration in config.json) but before the `pivot_root` or any equivalent operation has been executed.
606
607 The `createRuntime` hooks' path MUST resolve in the [runtime namespace](glossary.md#runtime-namespace).
608 The `createRuntime` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace).
609
610 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).
611
612 The definition of `createRuntime` hooks is currently underspecified and hooks authors, should only expect from the runtime that the mount namespace have been created and the mount operations performed. Other operations such as cgroups and SELinux/AppArmor labels might not have been performed by the runtime.
613
614 ### <a name="configHooksCreateContainer" />CreateContainer Hooks
615
616 The `createContainer` hooks MUST be called as part of the [`create`](runtime.md#create) operation after the runtime environment has been created (according to the configuration in config.json) but before the `pivot_root` or any equivalent operation has been executed.
617 The `createContainer` hooks MUST be called after the `createRuntime` hooks.
618
619 The `createContainer` hooks' path MUST resolve in the [runtime namespace](glossary.md#runtime-namespace).
620 The `createContainer` hooks MUST be executed in the [container namespace](glossary.md#container-namespace).
621
622 For example, on Linux this would happen before the `pivot_root` operation is executed but after the mount namespace was created and setup.
623
624 The definition of `createContainer` hooks is currently underspecified and hooks authors, should only expect from the runtime that the mount namespace and different mounts will be setup. Other operations such as cgroups and SELinux/AppArmor labels might not have been performed by the runtime.
625
626 ### <a name="configHooksStartContainer" />StartContainer Hooks
627
628 The `startContainer` hooks MUST be called [before the user-specified process is executed](runtime.md#lifecycle) as part of the [`start`](runtime.md#start) operation.
629 This hook can be used to execute some operations in the container, for example running the `ldconfig` binary on linux before the container process is spawned.
630
631 The `startContainer` hooks' path MUST resolve in the [container namespace](glossary.md#container-namespace).
632 The `startContainer` hooks MUST be executed in the [container namespace](glossary.md#container-namespace).
633
634 ### <a name="configHooksPoststart" />Poststart
635
636 The `poststart` hooks MUST be called [after the user-specified process is executed](runtime.md#lifecycle) but before the [`start`](runtime.md#start) operation returns.
637 For example, this hook can notify the user that the container process is spawned.
638
639 The `poststart` hooks' path MUST resolve in the [runtime namespace](glossary.md#runtime-namespace).
640 The `poststart` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace).
641
642 ### <a name="configHooksPoststop" />Poststop
643
644 The `poststop` hooks MUST be called [after the container is deleted](runtime.md#lifecycle) but before the [`delete`](runtime.md#delete) operation returns.
645 Cleanup or debugging functions are examples of such a hook.
646
647 The `poststop` hooks' path MUST resolve in the [runtime namespace](glossary.md#runtime-namespace).
648 The `poststop` hooks MUST be executed in the [runtime namespace](glossary.md#runtime-namespace).
649
650 ### Summary
651
652 See the below table for a summary of hooks and when they are called:
653
654 | Name | Namespace | When |
655 | ----------------------- | --------- | -----------------------------------------------------------------------------------------------------------------------------------|
656 | `prestart` (Deprecated) | runtime | During the create operation, after the runtime environment has been created and before the pivot root or any equivalent operation. |
657 | `createRuntime` | runtime | During the create operation, after the runtime environment has been created and before the pivot root or any equivalent operation. |
658 | `createContainer` | container | During the create operation, after the runtime environment has been created and before the pivot root or any equivalent operation. |
659 | `startContainer` | container | After the start operation is called but before the user-specified program command is executed. |
660 | `poststart` | runtime | After the user-specified process is executed but before the start operation returns. |
661 | `poststop` | runtime | After the container is deleted but before the delete operation returns. |
662
663 ### Example
664
665 ```json
666 "hooks": {
667 "prestart": [
668 {
669 "path": "/usr/bin/fix-mounts",
670 "args": ["fix-mounts", "arg1", "arg2"],
671 "env": [ "key1=value1"]
672 },
673 {
674 "path": "/usr/bin/setup-network"
675 }
676 ],
677 "createRuntime": [
678 {
679 "path": "/usr/bin/fix-mounts",
680 "args": ["fix-mounts", "arg1", "arg2"],
681 "env": [ "key1=value1"]
682 },
683 {
684 "path": "/usr/bin/setup-network"
685 }
686 ],
687 "createContainer": [
688 {
689 "path": "/usr/bin/mount-hook",
690 "args": ["-mount", "arg1", "arg2"],
691 "env": [ "key1=value1"]
692 }
693 ],
694 "startContainer": [
695 {
696 "path": "/usr/bin/refresh-ldcache"
697 }
698 ],
699 "poststart": [
700 {
701 "path": "/usr/bin/notify-start",
702 "timeout": 5
703 }
704 ],
705 "poststop": [
706 {
707 "path": "/usr/sbin/cleanup.sh",
708 "args": ["cleanup.sh", "-f"]
709 }
710 ]
711 }
712 ```
713
714 ## <a name="configAnnotations" />Annotations
715
716 **`annotations`** (object, OPTIONAL) contains arbitrary metadata for the container.
717 This information MAY be structured or unstructured.
718 Annotations MUST be a key-value map.
719 If there are no annotations then this property MAY either be absent or an empty map.
720
721 Keys MUST be strings.
722 Keys MUST NOT be an empty string.
723 Keys SHOULD be named using a reverse domain notation - e.g. `com.example.myKey`.
724
725 The `org.opencontainers` namespace for keys is reserved for use by this specification, annotations using keys in this namespace MUST be as described in this section.
726 The following keys in the `org.opencontainers` namespaces MAY be used:
727 | Key | Definition |
728 | --------------------------------------- | -----------------------------------------------------------------------------------------------------------------------------------|
729 | `org.opencontainers.image.os` | Indicates the operating system the container image was built to run on. The annotation value MUST have a valid value for the `os` property as defined in [the OCI image specification][oci-image-config-properties]. This annotation SHOULD only be used in accordance with the [OCI image specification's runtime conversion specification][oci-image-conversion]. |
730 | `org.opencontainers.image.os.version` | Indicates the operating system version targeted by the container image. The annotation value MUST have a valid value for the `os.version` property as defined in [the OCI image specification][oci-image-config-properties]. This annotation SHOULD only be used in accordance with the [OCI image specification's runtime conversion specification][oci-image-conversion]. |
731 | `org.opencontainers.image.os.features` | Indicates mandatory operating system features required by the container image. The annotation value MUST have a valid value for the `os.features` property as defined in [the OCI image specification][oci-image-config-properties]. This annotation SHOULD only be used in accordance with the [OCI image specification's runtime conversion specification][oci-image-conversion]. |
732 | `org.opencontainers.image.architecture` | Indicates the architecture that binaries in the container image are built to run on. The annotation value MUST have a valid value for the `architecture` property as defined in [the OCI image specification][oci-image-config-properties]. This annotation SHOULD only be used in accordance with the [OCI image specification's runtime conversion specification][oci-image-conversion]. |
733 | `org.opencontainers.image.variant` | Indicates the variant of the architecture that binaries in the container image are built to run on. The annotation value MUST have a valid value for the `variant` property as defined in [the OCI image specification][oci-image-config-properties]. This annotation SHOULD only be used in accordance with the [OCI image specification's runtime conversion specification][oci-image-conversion]. |
734 | `org.opencontainers.image.author` | Indicates the author of the container image. The annotation value MUST have a valid value for the `author` property as defined in [the OCI image specification][oci-image-config-properties]. This annotation SHOULD only be used in accordance with the [OCI image specification's runtime conversion specification][oci-image-conversion]. |
735 | `org.opencontainers.image.created` | Indicates the date and time when the container image was created. The annotation value MUST have a valid value for the `created` property as defined in [the OCIimage specification][oci-image-config-properties]. This annotation SHOULD only be used in accordance with the [OCI image specification's runtime conversion specification][oci-image-conversion]. |
736 | `org.opencontainers.image.stopSignal` | Indicates signal that SHOULD be sent by the container runtimes to [kill the container](runtime.md#kill). The annotation value MUST have a valid value for the `config.StopSignal` property as defined in [the OCI image specification][oci-image-config-properties]. This annotation SHOULD only be used in accordance with the [OCI image specification's runtime conversion specification][oci-image-conversion]. |
737
738 All other keys in the `org.opencontainers` namespace not specified in this above table are reserved and MUST NOT be used by subsequent specifications.
739 Runtimes MUST handle unknown annotation keys like any other [unknown property](#extensibility).
740
741 Values MUST be strings.
742 Values MAY be an empty string.
743
744 ```json
745 "annotations": {
746 "com.example.gpu-cores": "2"
747 }
748 ```
749
750 ## <a name="configExtensibility" />Extensibility
751
752 Runtimes MAY [log](runtime.md#warnings) unknown properties but MUST otherwise ignore them.
753 That includes not [generating errors](runtime.md#errors) if they encounter an unknown property.
754
755 ## Valid values
756
757 Runtimes MUST generate an error when invalid or unsupported values are encountered.
758 Unless support for a valid value is explicitly required, runtimes MAY choose which subset of the valid values it will support.
759
760 ## Configuration Schema Example
761
762 Here is a full example `config.json` for reference.
763
764 ```json
765 {
766 "ociVersion": "1.0.1",
767 "process": {
768 "terminal": true,
769 "user": {
770 "uid": 1,
771 "gid": 1,
772 "additionalGids": [
773 5,
774 6
775 ]
776 },
777 "args": [
778 "sh"
779 ],
780 "env": [
781 "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
782 "TERM=xterm"
783 ],
784 "cwd": "/",
785 "capabilities": {
786 "bounding": [
787 "CAP_AUDIT_WRITE",
788 "CAP_KILL",
789 "CAP_NET_BIND_SERVICE"
790 ],
791 "permitted": [
792 "CAP_AUDIT_WRITE",
793 "CAP_KILL",
794 "CAP_NET_BIND_SERVICE"
795 ],
796 "inheritable": [
797 "CAP_AUDIT_WRITE",
798 "CAP_KILL",
799 "CAP_NET_BIND_SERVICE"
800 ],
801 "effective": [
802 "CAP_AUDIT_WRITE",
803 "CAP_KILL"
804 ],
805 "ambient": [
806 "CAP_NET_BIND_SERVICE"
807 ]
808 },
809 "rlimits": [
810 {
811 "type": "RLIMIT_CORE",
812 "hard": 1024,
813 "soft": 1024
814 },
815 {
816 "type": "RLIMIT_NOFILE",
817 "hard": 1024,
818 "soft": 1024
819 }
820 ],
821 "apparmorProfile": "acme_secure_profile",
822 "oomScoreAdj": 100,
823 "selinuxLabel": "system_u:system_r:svirt_lxc_net_t:s0:c124,c675",
824 "ioPriority": {
825 "class": "IOPRIO_CLASS_IDLE",
826 "priority": 4
827 },
828 "noNewPrivileges": true
829 },
830 "root": {
831 "path": "rootfs",
832 "readonly": true
833 },
834 "hostname": "slartibartfast",
835 "mounts": [
836 {
837 "destination": "/proc",
838 "type": "proc",
839 "source": "proc"
840 },
841 {
842 "destination": "/dev",
843 "type": "tmpfs",
844 "source": "tmpfs",
845 "options": [
846 "nosuid",
847 "strictatime",
848 "mode=755",
849 "size=65536k"
850 ]
851 },
852 {
853 "destination": "/dev/pts",
854 "type": "devpts",
855 "source": "devpts",
856 "options": [
857 "nosuid",
858 "noexec",
859 "newinstance",
860 "ptmxmode=0666",
861 "mode=0620",
862 "gid=5"
863 ]
864 },
865 {
866 "destination": "/dev/shm",
867 "type": "tmpfs",
868 "source": "shm",
869 "options": [
870 "nosuid",
871 "noexec",
872 "nodev",
873 "mode=1777",
874 "size=65536k"
875 ]
876 },
877 {
878 "destination": "/dev/mqueue",
879 "type": "mqueue",
880 "source": "mqueue",
881 "options": [
882 "nosuid",
883 "noexec",
884 "nodev"
885 ]
886 },
887 {
888 "destination": "/sys",
889 "type": "sysfs",
890 "source": "sysfs",
891 "options": [
892 "nosuid",
893 "noexec",
894 "nodev"
895 ]
896 },
897 {
898 "destination": "/sys/fs/cgroup",
899 "type": "cgroup",
900 "source": "cgroup",
901 "options": [
902 "nosuid",
903 "noexec",
904 "nodev",
905 "relatime",
906 "ro"
907 ]
908 }
909 ],
910 "hooks": {
911 "prestart": [
912 {
913 "path": "/usr/bin/fix-mounts",
914 "args": [
915 "fix-mounts",
916 "arg1",
917 "arg2"
918 ],
919 "env": [
920 "key1=value1"
921 ]
922 },
923 {
924 "path": "/usr/bin/setup-network"
925 }
926 ],
927 "poststart": [
928 {
929 "path": "/usr/bin/notify-start",
930 "timeout": 5
931 }
932 ],
933 "poststop": [
934 {
935 "path": "/usr/sbin/cleanup.sh",
936 "args": [
937 "cleanup.sh",
938 "-f"
939 ]
940 }
941 ]
942 },
943 "linux": {
944 "devices": [
945 {
946 "path": "/dev/fuse",
947 "type": "c",
948 "major": 10,
949 "minor": 229,
950 "fileMode": 438,
951 "uid": 0,
952 "gid": 0
953 },
954 {
955 "path": "/dev/sda",
956 "type": "b",
957 "major": 8,
958 "minor": 0,
959 "fileMode": 432,
960 "uid": 0,
961 "gid": 0
962 }
963 ],
964 "uidMappings": [
965 {
966 "containerID": 0,
967 "hostID": 1000,
968 "size": 32000
969 }
970 ],
971 "gidMappings": [
972 {
973 "containerID": 0,
974 "hostID": 1000,
975 "size": 32000
976 }
977 ],
978 "sysctl": {
979 "net.ipv4.ip_forward": "1",
980 "net.core.somaxconn": "256"
981 },
982 "cgroupsPath": "/myRuntime/myContainer",
983 "resources": {
984 "network": {
985 "classID": 1048577,
986 "priorities": [
987 {
988 "name": "eth0",
989 "priority": 500
990 },
991 {
992 "name": "eth1",
993 "priority": 1000
994 }
995 ]
996 },
997 "pids": {
998 "limit": 32771
999 },
1000 "hugepageLimits": [
1001 {
1002 "pageSize": "2MB",
1003 "limit": 9223372036854772000
1004 },
1005 {
1006 "pageSize": "64KB",
1007 "limit": 1000000
1008 }
1009 ],
1010 "memory": {
1011 "limit": 536870912,
1012 "reservation": 536870912,
1013 "swap": 536870912,
1014 "kernel": -1,
1015 "kernelTCP": -1,
1016 "swappiness": 0,
1017 "disableOOMKiller": false
1018 },
1019 "cpu": {
1020 "shares": 1024,
1021 "quota": 1000000,
1022 "period": 500000,
1023 "realtimeRuntime": 950000,
1024 "realtimePeriod": 1000000,
1025 "cpus": "2-3",
1026 "idle": 1,
1027 "mems": "0-7"
1028 },
1029 "devices": [
1030 {
1031 "allow": false,
1032 "access": "rwm"
1033 },
1034 {
1035 "allow": true,
1036 "type": "c",
1037 "major": 10,
1038 "minor": 229,
1039 "access": "rw"
1040 },
1041 {
1042 "allow": true,
1043 "type": "b",
1044 "major": 8,
1045 "minor": 0,
1046 "access": "r"
1047 }
1048 ],
1049 "blockIO": {
1050 "weight": 10,
1051 "leafWeight": 10,
1052 "weightDevice": [
1053 {
1054 "major": 8,
1055 "minor": 0,
1056 "weight": 500,
1057 "leafWeight": 300
1058 },
1059 {
1060 "major": 8,
1061 "minor": 16,
1062 "weight": 500
1063 }
1064 ],
1065 "throttleReadBpsDevice": [
1066 {
1067 "major": 8,
1068 "minor": 0,
1069 "rate": 600
1070 }
1071 ],
1072 "throttleWriteIOPSDevice": [
1073 {
1074 "major": 8,
1075 "minor": 16,
1076 "rate": 300
1077 }
1078 ]
1079 }
1080 },
1081 "rootfsPropagation": "slave",
1082 "seccomp": {
1083 "defaultAction": "SCMP_ACT_ALLOW",
1084 "architectures": [
1085 "SCMP_ARCH_X86",
1086 "SCMP_ARCH_X32"
1087 ],
1088 "syscalls": [
1089 {
1090 "names": [
1091 "getcwd",
1092 "chmod"
1093 ],
1094 "action": "SCMP_ACT_ERRNO"
1095 }
1096 ]
1097 },
1098 "timeOffsets": {
1099 "monotonic": {
1100 "secs": 172800,
1101 "nanosecs": 0
1102 },
1103 "boottime": {
1104 "secs": 604800,
1105 "nanosecs": 0
1106 }
1107 },
1108 "namespaces": [
1109 {
1110 "type": "pid"
1111 },
1112 {
1113 "type": "network"
1114 },
1115 {
1116 "type": "ipc"
1117 },
1118 {
1119 "type": "uts"
1120 },
1121 {
1122 "type": "mount"
1123 },
1124 {
1125 "type": "user"
1126 },
1127 {
1128 "type": "cgroup"
1129 },
1130 {
1131 "type": "time"
1132 }
1133 ],
1134 "maskedPaths": [
1135 "/proc/kcore",
1136 "/proc/latency_stats",
1137 "/proc/timer_stats",
1138 "/proc/sched_debug"
1139 ],
1140 "readonlyPaths": [
1141 "/proc/asound",
1142 "/proc/bus",
1143 "/proc/fs",
1144 "/proc/irq",
1145 "/proc/sys",
1146 "/proc/sysrq-trigger"
1147 ],
1148 "mountLabel": "system_u:object_r:svirt_sandbox_file_t:s0:c715,c811"
1149 },
1150 "annotations": {
1151 "com.example.key1": "value1",
1152 "com.example.key2": "value2"
1153 }
1154 }
1155 ```
1156
1157
1158 [apparmor]: https://wiki.ubuntu.com/AppArmor
1159 [cgroup-v1-memory_2]: https://www.kernel.org/doc/Documentation/cgroup-v1/memory.txt
1160 [selinux]:https://selinuxproject.org/page/Main_Page
1161 [no-new-privs]: https://www.kernel.org/doc/Documentation/prctl/no_new_privs.txt
1162 [proc_2]: https://www.kernel.org/doc/Documentation/filesystems/proc.txt
1163 [umask.2]: https://pubs.opengroup.org/onlinepubs/009695399/functions/umask.html
1164 [semver-v2.0.0]: https://semver.org/spec/v2.0.0.html
1165 [ieee-1003.1-2008-xbd-c8.1]: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html#tag_08_01
1166 [ieee-1003.1-2008-functions-exec]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html
1167 [naming-a-volume]: https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-volume
1168 [oci-image-config-properties]: https://github.com/opencontainers/image-spec/blob/v1.1.0-rc2/config.md#properties
1169 [oci-image-conversion]: https://github.com/opencontainers/image-spec/blob/v1.1.0-rc2/conversion.md
1170
1171 [capabilities.7]: https://man7.org/linux/man-pages/man7/capabilities.7.html
1172 [mount.2]: https://man7.org/linux/man-pages/man2/mount.2.html
1173 [mount.8]: https://man7.org/linux/man-pages/man8/mount.8.html
1174 [mount.8-filesystem-independent]: https://man7.org/linux/man-pages/man8/mount.8.html#FILESYSTEM-INDEPENDENT_MOUNT_OPTIONS
1175 [mount.8-filesystem-specific]: https://man7.org/linux/man-pages/man8/mount.8.html#FILESYSTEM-SPECIFIC_MOUNT_OPTIONS
1176 [mount_setattr.2]: https://man7.org/linux/man-pages/man2/mount_setattr.2.html
1177 [mount-bind]: https://docs.kernel.org/filesystems/sharedsubtree.html
1178 [getrlimit.2]: https://man7.org/linux/man-pages/man2/getrlimit.2.html
1179 [getrlimit.3]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/getrlimit.html
1180 [stdin.3]: https://man7.org/linux/man-pages/man3/stdin.3.html
1181 [uts-namespace.7]: https://man7.org/linux/man-pages/man7/namespaces.7.html
1182 [zonecfg.1m]: https://docs.oracle.com/cd/E86824_01/html/E54764/zonecfg-1m.html