2016-01-20 00:27:47 +08:00
|
|
|
{
|
2016-05-27 07:31:13 +08:00
|
|
|
"description": "Open Container Runtime Specification Container Configuration Schema",
|
2016-01-20 00:27:47 +08:00
|
|
|
"$schema": "http://json-schema.org/draft-04/schema#",
|
|
|
|
"id": "https://opencontainers.org/schema/bundle",
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"ociVersion": {
|
|
|
|
"id": "https://opencontainers.org/schema/bundle/ociVersion",
|
2016-06-02 06:46:17 +08:00
|
|
|
"$ref": "defs.json#/definitions/ociVersion"
|
2016-01-20 00:27:47 +08:00
|
|
|
},
|
|
|
|
"hooks": {
|
|
|
|
"id": "https://opencontainers.org/schema/bundle/hooks",
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"prestart": {
|
|
|
|
"$ref": "defs.json#/definitions/ArrayOfHooks"
|
|
|
|
},
|
|
|
|
"poststart": {
|
|
|
|
"$ref": "defs.json#/definitions/ArrayOfHooks"
|
|
|
|
},
|
|
|
|
"poststop": {
|
|
|
|
"$ref": "defs.json#/definitions/ArrayOfHooks"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"annotations": {
|
2016-06-07 00:54:28 +08:00
|
|
|
"$ref": "defs.json#/definitions/annotations"
|
2016-01-20 00:27:47 +08:00
|
|
|
},
|
|
|
|
"hostname": {
|
|
|
|
"id": "https://opencontainers.org/schema/bundle/hostname",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"mounts": {
|
|
|
|
"id": "https://opencontainers.org/schema/bundle/mounts",
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "defs.json#/definitions/Mount"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"platform": {
|
|
|
|
"id": "https://opencontainers.org/schema/bundle/platform",
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"arch",
|
|
|
|
"os"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"arch": {
|
|
|
|
"id": "https://opencontainers.org/schema/bundle/platform/arch",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"os": {
|
|
|
|
"id": "https://opencontainers.org/schema/bundle/platform/os",
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"root": {
|
2016-08-03 14:53:32 +08:00
|
|
|
"description": "Configures the container's root filesystem.",
|
2016-01-20 00:27:47 +08:00
|
|
|
"id": "https://opencontainers.org/schema/bundle/root",
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"path": {
|
|
|
|
"id": "https://opencontainers.org/schema/bundle/root/path",
|
|
|
|
"$ref": "defs.json#/definitions/FilePath"
|
|
|
|
},
|
|
|
|
"readonly": {
|
|
|
|
"id": "https://opencontainers.org/schema/bundle/root/readonly",
|
|
|
|
"type": "boolean"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"process": {
|
|
|
|
"id": "https://opencontainers.org/schema/bundle/process",
|
|
|
|
"type": "object",
|
|
|
|
"required": [
|
|
|
|
"cwd",
|
|
|
|
"args"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"args": {
|
|
|
|
"id": "https://opencontainers.org/schema/bundle/process/args",
|
|
|
|
"$ref": "defs.json#/definitions/ArrayOfStrings"
|
|
|
|
},
|
|
|
|
"cwd": {
|
|
|
|
"id": "https://opencontainers.org/schema/bundle/process/cwd",
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"env": {
|
|
|
|
"id": "https://opencontainers.org/schema/bundle/process/env",
|
|
|
|
"$ref": "defs.json#/definitions/Env"
|
|
|
|
},
|
|
|
|
"terminal": {
|
|
|
|
"id": "https://opencontainers.org/schema/bundle/process/terminal",
|
|
|
|
"type": "boolean"
|
|
|
|
},
|
|
|
|
"user": {
|
|
|
|
"id": "https://opencontainers.org/schema/bundle/process/user",
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"uid": {
|
|
|
|
"id": "https://opencontainers.org/schema/bundle/process/user/uid",
|
|
|
|
"$ref": "defs.json#/definitions/UID"
|
|
|
|
},
|
|
|
|
"gid": {
|
|
|
|
"id": "https://opencontainers.org/schema/bundle/process/user/gid",
|
|
|
|
"$ref": "defs.json#/definitions/GID"
|
|
|
|
},
|
|
|
|
"additionalGids": {
|
|
|
|
"id": "https://opencontainers.org/schema/bundle/process/user/additionalGids",
|
|
|
|
"$ref": "defs.json#/definitions/ArrayOfGIDs"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"capabilities": {
|
|
|
|
"id": "https://opencontainers.org/schema/bundle/process/linux/capabilities",
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "defs-linux.json#/definitions/Capability"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"apparmorProfile": {
|
|
|
|
"id": "https://opencontainers.org/schema/bundle/process/linux/apparmorProfile",
|
|
|
|
"type": "string"
|
|
|
|
},
|
2016-04-23 04:51:31 +08:00
|
|
|
"selinuxLabel": {
|
|
|
|
"id": "https://opencontainers.org/schema/bundle/process/linux/selinuxLabel",
|
2016-01-20 00:27:47 +08:00
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
"noNewPrivileges": {
|
|
|
|
"id": "https://opencontainers.org/schema/bundle/process/linux/noNewPrivileges",
|
|
|
|
"type": "boolean"
|
2016-04-07 05:04:18 +08:00
|
|
|
},
|
|
|
|
"rlimits": {
|
|
|
|
"id": "https://opencontainers.org/schema/bundle/linux/rlimits",
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"id": "https://opencontainers.org/schema/bundle/linux/rlimits/0",
|
|
|
|
"type": "object",
|
|
|
|
"properties": {
|
|
|
|
"hard": {
|
|
|
|
"id": "https://opencontainers.org/schema/bundle/linux/rlimits/0/hard",
|
|
|
|
"$ref": "defs.json#/definitions/uint64"
|
|
|
|
},
|
|
|
|
"soft": {
|
|
|
|
"id": "https://opencontainers.org/schema/bundle/linux/rlimits/0/soft",
|
|
|
|
"$ref": "defs.json#/definitions/uint64"
|
|
|
|
},
|
|
|
|
"type": {
|
|
|
|
"id": "https://opencontainers.org/schema/bundle/linux/rlimits/0/type",
|
|
|
|
"type": "string",
|
|
|
|
"pattern": "^RLIMIT_[A-Z]+$"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2016-01-20 00:27:47 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"linux": {
|
2016-06-02 06:39:16 +08:00
|
|
|
"$ref": "config-linux.json#/linux"
|
2016-04-26 11:03:09 +08:00
|
|
|
},
|
|
|
|
"solaris": {
|
2016-06-02 06:39:16 +08:00
|
|
|
"$ref": "config-solaris.json#/solaris"
|
2016-09-17 04:35:23 +08:00
|
|
|
},
|
|
|
|
"windows": {
|
|
|
|
"$ref": "config-windows.json#/windows"
|
2016-01-20 00:27:47 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"required": [
|
|
|
|
"ociVersion",
|
|
|
|
"platform",
|
|
|
|
"process",
|
|
|
|
"root",
|
config: Explicitly list 'hooks' as optional
And make it omitempty, otherwise:
$ ocitools generate --template <(echo '{}')
$ cat config.json | jq -S .
{
"hooks": {},
...
}
To provide space for the type information and 'optional', I've
shuffled the hook docs to follow our usual:
* **`{property}`** ({type}, {when-needed}) {notes}
format. I've kept the separate event-trigger sections (e.g. "###
Prestart") since they go into more detail on the timing, purpose, and
exit handling for the different events (and that seemed like too much
information to put into the nested lists).
I've replaced the Go reference from 48049d2 (Clarify the semantics of
hook elements, 2015-11-25, #255) with POSIX references (following the
new process docs) to address pushback against referencing Go [1,2] in
favor of POSIX links [3]. Rob Dolin had suggested
"platform-appropriate" wording [4], but it seems like Visual Studio
2015 supports execv [5], and providing an explicit
"platform-appropriate" wiggle seems like it's adding useless
complication.
[1]: https://github.com/opencontainers/runtime-spec/pull/427#discussion_r62362761
[2]: http://ircbot.wl.linuxfoundation.org/meetings/opencontainers/2016/opencontainers.2016-05-18-17.01.log.html#l-46
[3]: http://ircbot.wl.linuxfoundation.org/meetings/opencontainers/2016/opencontainers.2016-05-18-17.01.log.html#l-52
[4]: http://ircbot.wl.linuxfoundation.org/meetings/opencontainers/2016/opencontainers.2016-05-18-17.01.log.html#l-54
[5]: https://msdn.microsoft.com/en-us/library/886kc0as.aspx
Signed-off-by: W. Trevor King <wking@tremily.us>
2016-05-06 23:48:36 +08:00
|
|
|
"mounts"
|
2016-01-20 00:27:47 +08:00
|
|
|
]
|
|
|
|
}
|