...

Text file src/github.com/opencontainers/runtime-spec/features.md

Documentation: github.com/opencontainers/runtime-spec

     1# <a name="features" />Features Structure
     2
     3A [runtime](glossary.md#runtime) MAY provide a JSON structure about its implemented features to [runtime callers](glossary.md#runtime-caller).
     4This JSON structure is called ["Features structure"](glossary.md#features-structure).
     5
     6The Features structure is irrelevant to the actual availability of the features in the host operating system.
     7Hence, the content of the Features structure SHOULD be determined on the compilation time of the runtime, not on the execution time.
     8
     9All properties in the Features structure except `ociVersionMin` and `ociVersionMax` MAY either be absent or have the `null` value.
    10The `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#hooks).
    32  The runtime MUST support the elements in this array as the [`hooks` property of `config.json`](config.md#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.
   130This information MAY be structured or unstructured.
   131Annotations 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).
   132However, annotations do not need to contain the possible values of the [`annotations` property of `config.json`](config.md#annotations).
   133The 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# Example
   144
   145Here is a full example for reference.
   146
   147```json
   148{
   149  "ociVersionMin": "1.0.0",
   150  "ociVersionMax": "1.1.0-rc.2",
   151  "hooks": [
   152    "prestart",
   153    "createRuntime",
   154    "createContainer",
   155    "startContainer",
   156    "poststart",
   157    "poststop"
   158  ],
   159  "mountOptions": [
   160    "async",
   161    "atime",
   162    "bind",
   163    "defaults",
   164    "dev",
   165    "diratime",
   166    "dirsync",
   167    "exec",
   168    "iversion",
   169    "lazytime",
   170    "loud",
   171    "mand",
   172    "noatime",
   173    "nodev",
   174    "nodiratime",
   175    "noexec",
   176    "noiversion",
   177    "nolazytime",
   178    "nomand",
   179    "norelatime",
   180    "nostrictatime",
   181    "nosuid",
   182    "nosymfollow",
   183    "private",
   184    "ratime",
   185    "rbind",
   186    "rdev",
   187    "rdiratime",
   188    "relatime",
   189    "remount",
   190    "rexec",
   191    "rnoatime",
   192    "rnodev",
   193    "rnodiratime",
   194    "rnoexec",
   195    "rnorelatime",
   196    "rnostrictatime",
   197    "rnosuid",
   198    "rnosymfollow",
   199    "ro",
   200    "rprivate",
   201    "rrelatime",
   202    "rro",
   203    "rrw",
   204    "rshared",
   205    "rslave",
   206    "rstrictatime",
   207    "rsuid",
   208    "rsymfollow",
   209    "runbindable",
   210    "rw",
   211    "shared",
   212    "silent",
   213    "slave",
   214    "strictatime",
   215    "suid",
   216    "symfollow",
   217    "sync",
   218    "tmpcopyup",
   219    "unbindable"
   220  ],
   221  "linux": {
   222    "namespaces": [
   223      "cgroup",
   224      "ipc",
   225      "mount",
   226      "network",
   227      "pid",
   228      "user",
   229      "uts"
   230    ],
   231    "capabilities": [
   232      "CAP_CHOWN",
   233      "CAP_DAC_OVERRIDE",
   234      "CAP_DAC_READ_SEARCH",
   235      "CAP_FOWNER",
   236      "CAP_FSETID",
   237      "CAP_KILL",
   238      "CAP_SETGID",
   239      "CAP_SETUID",
   240      "CAP_SETPCAP",
   241      "CAP_LINUX_IMMUTABLE",
   242      "CAP_NET_BIND_SERVICE",
   243      "CAP_NET_BROADCAST",
   244      "CAP_NET_ADMIN",
   245      "CAP_NET_RAW",
   246      "CAP_IPC_LOCK",
   247      "CAP_IPC_OWNER",
   248      "CAP_SYS_MODULE",
   249      "CAP_SYS_RAWIO",
   250      "CAP_SYS_CHROOT",
   251      "CAP_SYS_PTRACE",
   252      "CAP_SYS_PACCT",
   253      "CAP_SYS_ADMIN",
   254      "CAP_SYS_BOOT",
   255      "CAP_SYS_NICE",
   256      "CAP_SYS_RESOURCE",
   257      "CAP_SYS_TIME",
   258      "CAP_SYS_TTY_CONFIG",
   259      "CAP_MKNOD",
   260      "CAP_LEASE",
   261      "CAP_AUDIT_WRITE",
   262      "CAP_AUDIT_CONTROL",
   263      "CAP_SETFCAP",
   264      "CAP_MAC_OVERRIDE",
   265      "CAP_MAC_ADMIN",
   266      "CAP_SYSLOG",
   267      "CAP_WAKE_ALARM",
   268      "CAP_BLOCK_SUSPEND",
   269      "CAP_AUDIT_READ",
   270      "CAP_PERFMON",
   271      "CAP_BPF",
   272      "CAP_CHECKPOINT_RESTORE"
   273    ],
   274    "cgroup": {
   275      "v1": true,
   276      "v2": true,
   277      "systemd": true,
   278      "systemdUser": true,
   279      "rdma": true
   280    },
   281    "seccomp": {
   282      "enabled": true,
   283      "actions": [
   284        "SCMP_ACT_ALLOW",
   285        "SCMP_ACT_ERRNO",
   286        "SCMP_ACT_KILL",
   287        "SCMP_ACT_KILL_PROCESS",
   288        "SCMP_ACT_KILL_THREAD",
   289        "SCMP_ACT_LOG",
   290        "SCMP_ACT_NOTIFY",
   291        "SCMP_ACT_TRACE",
   292        "SCMP_ACT_TRAP"
   293      ],
   294      "operators": [
   295        "SCMP_CMP_EQ",
   296        "SCMP_CMP_GE",
   297        "SCMP_CMP_GT",
   298        "SCMP_CMP_LE",
   299        "SCMP_CMP_LT",
   300        "SCMP_CMP_MASKED_EQ",
   301        "SCMP_CMP_NE"
   302      ],
   303      "archs": [
   304        "SCMP_ARCH_AARCH64",
   305        "SCMP_ARCH_ARM",
   306        "SCMP_ARCH_MIPS",
   307        "SCMP_ARCH_MIPS64",
   308        "SCMP_ARCH_MIPS64N32",
   309        "SCMP_ARCH_MIPSEL",
   310        "SCMP_ARCH_MIPSEL64",
   311        "SCMP_ARCH_MIPSEL64N32",
   312        "SCMP_ARCH_PPC",
   313        "SCMP_ARCH_PPC64",
   314        "SCMP_ARCH_PPC64LE",
   315        "SCMP_ARCH_RISCV64",
   316        "SCMP_ARCH_S390",
   317        "SCMP_ARCH_S390X",
   318        "SCMP_ARCH_X32",
   319        "SCMP_ARCH_X86",
   320        "SCMP_ARCH_X86_64"
   321      ],
   322      "knownFlags": [
   323        "SECCOMP_FILTER_FLAG_TSYNC",
   324        "SECCOMP_FILTER_FLAG_SPEC_ALLOW",
   325        "SECCOMP_FILTER_FLAG_LOG"
   326      ],
   327      "supportedFlags": [
   328        "SECCOMP_FILTER_FLAG_TSYNC",
   329        "SECCOMP_FILTER_FLAG_SPEC_ALLOW",
   330        "SECCOMP_FILTER_FLAG_LOG"
   331      ]
   332    },
   333    "apparmor": {
   334      "enabled": true
   335    },
   336    "selinux": {
   337      "enabled": true
   338    },
   339    "intelRdt": {
   340      "enabled": true
   341    }
   342  },
   343  "annotations": {
   344    "io.github.seccomp.libseccomp.version": "2.5.4",
   345    "org.opencontainers.runc.checkpoint.enabled": "true",
   346    "org.opencontainers.runc.commit": "v1.1.0-534-g26851168",
   347    "org.opencontainers.runc.version": "1.1.0+dev"
   348  }
   349}
   350```
   351
   352[mount.2]: https://man7.org/linux/man-pages/man2/mount.2.html

View as plain text