| 1 | # <a name="features" />Features Structure |
| 2 | |
| 3 | A [runtime](glossary.md#runtime) MAY provide a JSON structure about its implemented features to [runtime callers](glossary.md#runtime-caller). |
| 4 | This JSON structure is called ["Features structure"](glossary.md#features-structure). |
| 5 | |
| 6 | The Features structure is irrelevant to the actual availability of the features in the host operating system. |
| 7 | Hence, the content of the Features structure SHOULD be determined on the compilation time of the runtime, not on the execution time. |
| 8 | |
| 9 | All properties in the Features structure except `ociVersionMin` and `ociVersionMax` MAY either be absent or have the `null` value. |
| 10 | The `null` value MUST NOT be confused with an empty value such as `0`, `false`, `""`, `[]`, and `{}`. |
| 11 | |
| 12 | ## <a name="featuresSpecificationVersion" />Specification version |
| 13 | |
| 14 | * **`ociVersionMin`** (string, REQUIRED) The minimum recognized version of the Open Container Initiative Runtime Specification. |
| 15 | The runtime MUST accept this value as the [`ociVersion` property of `config.json`](config.md#specification-version). |
| 16 | |
| 17 | * **`ociVersionMax`** (string, REQUIRED) The maximum recognized version of the Open Container Initiative Runtime Specification. |
| 18 | The runtime MUST accept this value as the [`ociVersion` property of `config.json`](config.md#specification-version). |
| 19 | The value MUST NOT be less than the value of the `ociVersionMin` property. |
| 20 | The Features structure MUST NOT contain properties that are not defined in this version of the Open Container Initiative Runtime Specification. |
| 21 | |
| 22 | ### Example |
| 23 | ```json |
| 24 | { |
| 25 | "ociVersionMin": "1.0.0", |
| 26 | "ociVersionMax": "1.1.0" |
| 27 | } |
| 28 | ``` |
| 29 | |
| 30 | ## <a name="featuresHooks" />Hooks |
| 31 | * **`hooks`** (array of strings, OPTIONAL) The recognized names of the [hooks](config.md#posix-platform-hooks). |
| 32 | The runtime MUST support the elements in this array as the [`hooks` property of `config.json`](config.md#posix-platform-hooks). |
| 33 | |
| 34 | ### Example |
| 35 | ```json |
| 36 | "hooks": [ |
| 37 | "prestart", |
| 38 | "createRuntime", |
| 39 | "createContainer", |
| 40 | "startContainer", |
| 41 | "poststart", |
| 42 | "poststop" |
| 43 | ] |
| 44 | ``` |
| 45 | |
| 46 | ## <a name="featuresMountOptions" />Mount Options |
| 47 | |
| 48 | * **`mountOptions`** (array of strings, OPTIONAL) The recognized names of the mount options, including options that might not be supported by the host operating system. |
| 49 | The runtime MUST recognize the elements in this array as the [`options` of `mounts` objects in `config.json`](config.md#mounts). |
| 50 | * Linux: this array SHOULD NOT contain filesystem-specific mount options that are passed to the [mount(2)][mount.2] syscall as `const void *data`. |
| 51 | |
| 52 | ### Example |
| 53 | |
| 54 | ```json |
| 55 | "mountOptions": [ |
| 56 | "acl", |
| 57 | "async", |
| 58 | "atime", |
| 59 | "bind", |
| 60 | "defaults", |
| 61 | "dev", |
| 62 | "diratime", |
| 63 | "dirsync", |
| 64 | "exec", |
| 65 | "iversion", |
| 66 | "lazytime", |
| 67 | "loud", |
| 68 | "mand", |
| 69 | "noacl", |
| 70 | "noatime", |
| 71 | "nodev", |
| 72 | "nodiratime", |
| 73 | "noexec", |
| 74 | "noiversion", |
| 75 | "nolazytime", |
| 76 | "nomand", |
| 77 | "norelatime", |
| 78 | "nostrictatime", |
| 79 | "nosuid", |
| 80 | "nosymfollow", |
| 81 | "private", |
| 82 | "ratime", |
| 83 | "rbind", |
| 84 | "rdev", |
| 85 | "rdiratime", |
| 86 | "relatime", |
| 87 | "remount", |
| 88 | "rexec", |
| 89 | "rnoatime", |
| 90 | "rnodev", |
| 91 | "rnodiratime", |
| 92 | "rnoexec", |
| 93 | "rnorelatime", |
| 94 | "rnostrictatime", |
| 95 | "rnosuid", |
| 96 | "rnosymfollow", |
| 97 | "ro", |
| 98 | "rprivate", |
| 99 | "rrelatime", |
| 100 | "rro", |
| 101 | "rrw", |
| 102 | "rshared", |
| 103 | "rslave", |
| 104 | "rstrictatime", |
| 105 | "rsuid", |
| 106 | "rsymfollow", |
| 107 | "runbindable", |
| 108 | "rw", |
| 109 | "shared", |
| 110 | "silent", |
| 111 | "slave", |
| 112 | "strictatime", |
| 113 | "suid", |
| 114 | "symfollow", |
| 115 | "sync", |
| 116 | "tmpcopyup", |
| 117 | "unbindable" |
| 118 | ] |
| 119 | ``` |
| 120 | |
| 121 | |
| 122 | ## <a name="featuresPlatformSpecificFeatures" />Platform-specific features |
| 123 | |
| 124 | * **`linux`** (object, OPTIONAL) [Linux-specific features](features-linux.md). |
| 125 | This MAY be set if the runtime supports `linux` platform. |
| 126 | |
| 127 | ## <a name="featuresAnnotations" />Annotations |
| 128 | |
| 129 | **`annotations`** (object, OPTIONAL) contains arbitrary metadata of the runtime. |
| 130 | This information MAY be structured or unstructured. |
| 131 | Annotations MUST be a key-value map that follows the same convention as the Key and Values of the [`annotations` property of `config.json`](config.md#annotations). |
| 132 | However, annotations do not need to contain the possible values of the [`annotations` property of `config.json`](config.md#annotations). |
| 133 | The current version of the spec do not provide a way to enumerate the possible values of the [`annotations` property of `config.json`](config.md#annotations). |
| 134 | |
| 135 | ### Example |
| 136 | ```json |
| 137 | "annotations": { |
| 138 | "org.opencontainers.runc.checkpoint.enabled": "true", |
| 139 | "org.opencontainers.runc.version": "1.1.0" |
| 140 | } |
| 141 | ``` |
| 142 | |
| 143 | ## <a name="featuresPotentiallyUnsafeConfigAnnotations" />Unsafe annotations in `config.json` |
| 144 | |
| 145 | **`potentiallyUnsafeConfigAnnotations`** (array of strings, OPTIONAL) contains values of [`annotations` property of `config.json`](config.md#annotations) |
| 146 | that may potentially change the behavior of the runtime. |
| 147 | |
| 148 | A value that ends with "." is interpreted as a prefix of annotations. |
| 149 | |
| 150 | ### Example |
| 151 | ```json |
| 152 | "potentiallyUnsafeConfigAnnotations": [ |
| 153 | "com.example.foo.bar", |
| 154 | "org.systemd.property." |
| 155 | ] |
| 156 | ``` |
| 157 | |
| 158 | The example above matches `com.example.foo.bar`, `org.systemd.property.ExecStartPre`, etc. |
| 159 | The example does not match `com.example.foo.bar.baz`. |
| 160 | |
| 161 | # Example |
| 162 | |
| 163 | Here is a full example for reference. |
| 164 | |
| 165 | ```json |
| 166 | { |
| 167 | "ociVersionMin": "1.0.0", |
| 168 | "ociVersionMax": "1.1.0-rc.2", |
| 169 | "hooks": [ |
| 170 | "prestart", |
| 171 | "createRuntime", |
| 172 | "createContainer", |
| 173 | "startContainer", |
| 174 | "poststart", |
| 175 | "poststop" |
| 176 | ], |
| 177 | "mountOptions": [ |
| 178 | "async", |
| 179 | "atime", |
| 180 | "bind", |
| 181 | "defaults", |
| 182 | "dev", |
| 183 | "diratime", |
| 184 | "dirsync", |
| 185 | "exec", |
| 186 | "iversion", |
| 187 | "lazytime", |
| 188 | "loud", |
| 189 | "mand", |
| 190 | "noatime", |
| 191 | "nodev", |
| 192 | "nodiratime", |
| 193 | "noexec", |
| 194 | "noiversion", |
| 195 | "nolazytime", |
| 196 | "nomand", |
| 197 | "norelatime", |
| 198 | "nostrictatime", |
| 199 | "nosuid", |
| 200 | "nosymfollow", |
| 201 | "private", |
| 202 | "ratime", |
| 203 | "rbind", |
| 204 | "rdev", |
| 205 | "rdiratime", |
| 206 | "relatime", |
| 207 | "remount", |
| 208 | "rexec", |
| 209 | "rnoatime", |
| 210 | "rnodev", |
| 211 | "rnodiratime", |
| 212 | "rnoexec", |
| 213 | "rnorelatime", |
| 214 | "rnostrictatime", |
| 215 | "rnosuid", |
| 216 | "rnosymfollow", |
| 217 | "ro", |
| 218 | "rprivate", |
| 219 | "rrelatime", |
| 220 | "rro", |
| 221 | "rrw", |
| 222 | "rshared", |
| 223 | "rslave", |
| 224 | "rstrictatime", |
| 225 | "rsuid", |
| 226 | "rsymfollow", |
| 227 | "runbindable", |
| 228 | "rw", |
| 229 | "shared", |
| 230 | "silent", |
| 231 | "slave", |
| 232 | "strictatime", |
| 233 | "suid", |
| 234 | "symfollow", |
| 235 | "sync", |
| 236 | "tmpcopyup", |
| 237 | "unbindable" |
| 238 | ], |
| 239 | "linux": { |
| 240 | "namespaces": [ |
| 241 | "cgroup", |
| 242 | "ipc", |
| 243 | "mount", |
| 244 | "network", |
| 245 | "pid", |
| 246 | "user", |
| 247 | "uts" |
| 248 | ], |
| 249 | "capabilities": [ |
| 250 | "CAP_CHOWN", |
| 251 | "CAP_DAC_OVERRIDE", |
| 252 | "CAP_DAC_READ_SEARCH", |
| 253 | "CAP_FOWNER", |
| 254 | "CAP_FSETID", |
| 255 | "CAP_KILL", |
| 256 | "CAP_SETGID", |
| 257 | "CAP_SETUID", |
| 258 | "CAP_SETPCAP", |
| 259 | "CAP_LINUX_IMMUTABLE", |
| 260 | "CAP_NET_BIND_SERVICE", |
| 261 | "CAP_NET_BROADCAST", |
| 262 | "CAP_NET_ADMIN", |
| 263 | "CAP_NET_RAW", |
| 264 | "CAP_IPC_LOCK", |
| 265 | "CAP_IPC_OWNER", |
| 266 | "CAP_SYS_MODULE", |
| 267 | "CAP_SYS_RAWIO", |
| 268 | "CAP_SYS_CHROOT", |
| 269 | "CAP_SYS_PTRACE", |
| 270 | "CAP_SYS_PACCT", |
| 271 | "CAP_SYS_ADMIN", |
| 272 | "CAP_SYS_BOOT", |
| 273 | "CAP_SYS_NICE", |
| 274 | "CAP_SYS_RESOURCE", |
| 275 | "CAP_SYS_TIME", |
| 276 | "CAP_SYS_TTY_CONFIG", |
| 277 | "CAP_MKNOD", |
| 278 | "CAP_LEASE", |
| 279 | "CAP_AUDIT_WRITE", |
| 280 | "CAP_AUDIT_CONTROL", |
| 281 | "CAP_SETFCAP", |
| 282 | "CAP_MAC_OVERRIDE", |
| 283 | "CAP_MAC_ADMIN", |
| 284 | "CAP_SYSLOG", |
| 285 | "CAP_WAKE_ALARM", |
| 286 | "CAP_BLOCK_SUSPEND", |
| 287 | "CAP_AUDIT_READ", |
| 288 | "CAP_PERFMON", |
| 289 | "CAP_BPF", |
| 290 | "CAP_CHECKPOINT_RESTORE" |
| 291 | ], |
| 292 | "cgroup": { |
| 293 | "v1": true, |
| 294 | "v2": true, |
| 295 | "systemd": true, |
| 296 | "systemdUser": true, |
| 297 | "rdma": true |
| 298 | }, |
| 299 | "seccomp": { |
| 300 | "enabled": true, |
| 301 | "actions": [ |
| 302 | "SCMP_ACT_ALLOW", |
| 303 | "SCMP_ACT_ERRNO", |
| 304 | "SCMP_ACT_KILL", |
| 305 | "SCMP_ACT_KILL_PROCESS", |
| 306 | "SCMP_ACT_KILL_THREAD", |
| 307 | "SCMP_ACT_LOG", |
| 308 | "SCMP_ACT_NOTIFY", |
| 309 | "SCMP_ACT_TRACE", |
| 310 | "SCMP_ACT_TRAP" |
| 311 | ], |
| 312 | "operators": [ |
| 313 | "SCMP_CMP_EQ", |
| 314 | "SCMP_CMP_GE", |
| 315 | "SCMP_CMP_GT", |
| 316 | "SCMP_CMP_LE", |
| 317 | "SCMP_CMP_LT", |
| 318 | "SCMP_CMP_MASKED_EQ", |
| 319 | "SCMP_CMP_NE" |
| 320 | ], |
| 321 | "archs": [ |
| 322 | "SCMP_ARCH_AARCH64", |
| 323 | "SCMP_ARCH_ARM", |
| 324 | "SCMP_ARCH_MIPS", |
| 325 | "SCMP_ARCH_MIPS64", |
| 326 | "SCMP_ARCH_MIPS64N32", |
| 327 | "SCMP_ARCH_MIPSEL", |
| 328 | "SCMP_ARCH_MIPSEL64", |
| 329 | "SCMP_ARCH_MIPSEL64N32", |
| 330 | "SCMP_ARCH_PPC", |
| 331 | "SCMP_ARCH_PPC64", |
| 332 | "SCMP_ARCH_PPC64LE", |
| 333 | "SCMP_ARCH_RISCV64", |
| 334 | "SCMP_ARCH_S390", |
| 335 | "SCMP_ARCH_S390X", |
| 336 | "SCMP_ARCH_X32", |
| 337 | "SCMP_ARCH_X86", |
| 338 | "SCMP_ARCH_X86_64" |
| 339 | ], |
| 340 | "knownFlags": [ |
| 341 | "SECCOMP_FILTER_FLAG_TSYNC", |
| 342 | "SECCOMP_FILTER_FLAG_SPEC_ALLOW", |
| 343 | "SECCOMP_FILTER_FLAG_LOG" |
| 344 | ], |
| 345 | "supportedFlags": [ |
| 346 | "SECCOMP_FILTER_FLAG_TSYNC", |
| 347 | "SECCOMP_FILTER_FLAG_SPEC_ALLOW", |
| 348 | "SECCOMP_FILTER_FLAG_LOG" |
| 349 | ] |
| 350 | }, |
| 351 | "apparmor": { |
| 352 | "enabled": true |
| 353 | }, |
| 354 | "selinux": { |
| 355 | "enabled": true |
| 356 | }, |
| 357 | "intelRdt": { |
| 358 | "enabled": true |
| 359 | } |
| 360 | }, |
| 361 | "annotations": { |
| 362 | "io.github.seccomp.libseccomp.version": "2.5.4", |
| 363 | "org.opencontainers.runc.checkpoint.enabled": "true", |
| 364 | "org.opencontainers.runc.commit": "v1.1.0-534-g26851168", |
| 365 | "org.opencontainers.runc.version": "1.1.0+dev" |
| 366 | } |
| 367 | } |
| 368 | ``` |
| 369 | |
| 370 | [mount.2]: https://man7.org/linux/man-pages/man2/mount.2.html |