Youki · JSON Structure

Oci Runtime Config Structure

Open Container Initiative Runtime Specification Container Configuration Schema

Type: object Properties: 14 Required: 1
ContainersContainer RuntimeOCIRustCNCFCloud NativeKubernetes

OciRuntimeConfig is a JSON Structure definition published by Youki, describing 14 properties, of which 1 is required. It conforms to the https://json-structure.org/meta/core/v0/# meta-schema.

Properties

ociVersion hooks annotations hostname domainname mounts root process linux solaris windows vm zos freebsd

Meta-schema: https://json-structure.org/meta/core/v0/#

JSON Structure

oci-runtime-config-structure.json Raw ↑
{
  "$schema": "https://json-structure.org/meta/core/v0/#",
  "$id": "https://raw.githubusercontent.com/api-evangelist/youki/refs/heads/main/json-structure/oci-runtime-config-structure.json",
  "name": "OciRuntimeConfig",
  "description": "Open Container Initiative Runtime Specification Container Configuration Schema",
  "type": "object",
  "properties": {
    "ociVersion": {
      "$ref": "defs.json#/definitions/ociVersion"
    },
    "hooks": {
      "type": "object",
      "properties": {
        "prestart": {
          "$ref": "defs.json#/definitions/ArrayOfHooks"
        },
        "createRuntime": {
          "$ref": "defs.json#/definitions/ArrayOfHooks"
        },
        "createContainer": {
          "$ref": "defs.json#/definitions/ArrayOfHooks"
        },
        "startContainer": {
          "$ref": "defs.json#/definitions/ArrayOfHooks"
        },
        "poststart": {
          "$ref": "defs.json#/definitions/ArrayOfHooks"
        },
        "poststop": {
          "$ref": "defs.json#/definitions/ArrayOfHooks"
        }
      }
    },
    "annotations": {
      "$ref": "defs.json#/definitions/annotations"
    },
    "hostname": {
      "type": "string"
    },
    "domainname": {
      "type": "string"
    },
    "mounts": {
      "type": "array",
      "items": {
        "$ref": "defs.json#/definitions/Mount"
      }
    },
    "root": {
      "description": "Configures the container's root filesystem.",
      "type": "object",
      "required": [
        "path"
      ],
      "properties": {
        "path": {
          "$ref": "defs.json#/definitions/FilePath"
        },
        "readonly": {
          "type": "boolean"
        }
      }
    },
    "process": {
      "type": "object",
      "required": [
        "cwd"
      ],
      "properties": {
        "args": {
          "$ref": "defs.json#/definitions/ArrayOfStrings"
        },
        "commandLine": {
          "type": "string"
        },
        "consoleSize": {
          "type": "object",
          "required": [
            "height",
            "width"
          ],
          "properties": {
            "height": {
              "$ref": "defs.json#/definitions/uint64"
            },
            "width": {
              "$ref": "defs.json#/definitions/uint64"
            }
          }
        },
        "cwd": {
          "type": "string"
        },
        "env": {
          "$ref": "defs.json#/definitions/Env"
        },
        "terminal": {
          "type": "boolean"
        },
        "user": {
          "type": "object",
          "properties": {
            "uid": {
              "$ref": "defs.json#/definitions/UID"
            },
            "gid": {
              "$ref": "defs.json#/definitions/GID"
            },
            "umask": {
              "$ref": "defs.json#/definitions/Umask"
            },
            "additionalGids": {
              "$ref": "defs.json#/definitions/ArrayOfGIDs"
            },
            "username": {
              "type": "string"
            }
          }
        },
        "capabilities": {
          "type": "object",
          "properties": {
            "bounding": {
              "$ref": "defs.json#/definitions/ArrayOfStrings"
            },
            "permitted": {
              "$ref": "defs.json#/definitions/ArrayOfStrings"
            },
            "effective": {
              "$ref": "defs.json#/definitions/ArrayOfStrings"
            },
            "inheritable": {
              "$ref": "defs.json#/definitions/ArrayOfStrings"
            },
            "ambient": {
              "$ref": "defs.json#/definitions/ArrayOfStrings"
            }
          }
        },
        "apparmorProfile": {
          "type": "string"
        },
        "oomScoreAdj": {
          "type": "int32"
        },
        "selinuxLabel": {
          "type": "string"
        },
        "ioPriority": {
          "type": "object",
          "required": [
            "class"
          ],
          "properties": {
            "class": {
              "type": "string",
              "enum": [
                "IOPRIO_CLASS_RT",
                "IOPRIO_CLASS_BE",
                "IOPRIO_CLASS_IDLE"
              ]
            },
            "priority": {
              "$ref": "defs.json#/definitions/int32"
            }
          }
        },
        "noNewPrivileges": {
          "type": "boolean"
        },
        "scheduler": {
          "type": "object",
          "required": [
            "policy"
          ],
          "properties": {
            "policy": {
              "$ref": "defs-linux.json#/definitions/SchedulerPolicy"
            },
            "nice": {
              "$ref": "defs.json#/definitions/int32"
            },
            "priority": {
              "$ref": "defs.json#/definitions/int32"
            },
            "flags": {
              "type": "array",
              "items": {
                "$ref": "defs-linux.json#/definitions/SchedulerFlag"
              }
            },
            "runtime": {
              "$ref": "defs.json#/definitions/uint64"
            },
            "deadline": {
              "$ref": "defs.json#/definitions/uint64"
            },
            "period": {
              "$ref": "defs.json#/definitions/uint64"
            }
          }
        },
        "rlimits": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "type",
              "soft",
              "hard"
            ],
            "properties": {
              "hard": {
                "$ref": "defs.json#/definitions/uint64"
              },
              "soft": {
                "$ref": "defs.json#/definitions/uint64"
              },
              "type": {
                "type": "string",
                "pattern": "^RLIMIT_[A-Z]+$"
              }
            }
          }
        },
        "execCPUAffinity": {
          "type": "object",
          "properties": {
            "initial": {
              "type": "string",
              "pattern": "^[0-9, -]*$"
            },
            "final": {
              "type": "string",
              "pattern": "^[0-9, -]*$"
            }
          }
        }
      }
    },
    "linux": {
      "$ref": "config-linux.json#/linux"
    },
    "solaris": {
      "$ref": "config-solaris.json#/solaris"
    },
    "windows": {
      "$ref": "config-windows.json#/windows"
    },
    "vm": {
      "$ref": "config-vm.json#/vm"
    },
    "zos": {
      "$ref": "config-zos.json#/zos"
    },
    "freebsd": {
      "$ref": "config-freebsd.json#/freebsd"
    }
  },
  "required": [
    "ociVersion"
  ]
}