From 0adccacb38f5862a94fedc811aa7f3b1e8009263 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Fri, 14 Jul 2017 17:05:31 -0400 Subject: [PATCH] Add Compose format 3.4 Signed-off-by: Daniel Nephin --- cli/compose/schema/bindata.go | 23 + .../schema/data/config_schema_v3.4.json | 534 ++++++++++++++++++ 2 files changed, 557 insertions(+) create mode 100644 cli/compose/schema/data/config_schema_v3.4.json diff --git a/cli/compose/schema/bindata.go b/cli/compose/schema/bindata.go index 06fcae3591..cba2c1e17c 100644 --- a/cli/compose/schema/bindata.go +++ b/cli/compose/schema/bindata.go @@ -4,6 +4,7 @@ // data/config_schema_v3.1.json // data/config_schema_v3.2.json // data/config_schema_v3.3.json +// data/config_schema_v3.4.json // DO NOT EDIT! package schema @@ -151,6 +152,26 @@ func dataConfig_schema_v33Json() (*asset, error) { return a, nil } +var _dataConfig_schema_v34Json = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x5b\xcd\x93\xdb\xa0\x15\xbf\xfb\xaf\xd0\x28\xb9\x65\x3f\x32\xd3\x4c\x67\x9a\x5b\x8f\x3d\xb5\xe7\xee\x38\x1a\x8c\x9e\x6d\xb2\x08\x08\x20\xef\x3a\x99\xfd\xdf\x3b\xfa\x34\x20\x10\xd8\xd6\x66\xb7\x6d\x4e\xbb\x96\x7e\x0f\x78\xdf\xef\x01\xfa\xb5\xca\xb2\xfc\xa3\xc2\x7b\xa8\x50\xfe\x35\xcb\xf7\x5a\x8b\xaf\xf7\xf7\xdf\x15\x67\xb7\xdd\xd3\x3b\x2e\x77\xf7\xa5\x44\x5b\x7d\xfb\xf9\xcb\x7d\xf7\xec\x43\x7e\xd3\xd0\x91\xb2\x21\xc1\x9c\x6d\xc9\xae\xe8\xde\x14\x87\xbf\xdc\x7d\xb9\x6b\xc8\x3b\x88\x3e\x0a\x68\x40\x7c\xf3\x1d\xb0\xee\x9e\x49\xf8\x51\x13\x09\x0d\xf1\x43\x7e\x00\xa9\x08\x67\xf9\xfa\x66\xd5\xbc\x13\x92\x0b\x90\x9a\x80\xca\xbf\x66\xcd\xe2\xb2\x6c\x84\x0c\x0f\x8c\x61\x95\x96\x84\xed\xf2\xf6\xf1\x4b\x3b\x42\x96\xe5\x0a\xe4\x81\x60\x63\x84\x71\xa9\x1f\xee\x4f\xe3\xdf\x8f\xb0\x1b\x77\x54\x63\xb1\xed\x73\x81\xb4\x06\xc9\xfe\x35\x5d\x5b\xfb\xfa\xdb\x03\xba\xfd\xf9\xf7\xdb\x7f\x7f\xbe\xfd\xdb\x5d\x71\xbb\xfe\xf4\xd1\x7a\xdd\xc8\x57\xc2\xb6\x9b\xbe\x84\x2d\x61\x44\x13\xce\xc6\xf9\xf3\x11\xf9\xd2\xff\xf7\x32\x4e\x8c\xca\xb2\x05\x23\x6a\xcd\xbd\x45\x54\x81\xcd\x33\x03\xfd\xc4\xe5\x63\x8c\xe7\x11\xf6\x46\x3c\xf7\xf3\x7b\x78\xb6\xd9\x39\x70\x5a\x57\x51\x0d\x0e\xa8\x37\x62\xa6\x9b\x7e\x19\xfd\x29\xc0\x12\x74\xdc\x64\x3b\xd4\x9b\x59\x6c\x33\xfd\x32\x0c\x77\x51\x23\xc6\xf0\x80\x7a\x23\x86\xbb\xe9\xaf\x63\x78\x35\x30\x3d\x8b\xed\x10\xc6\xdc\xed\x02\xad\x78\xe6\x13\x95\x2f\x9e\x84\x65\x35\x0a\x2b\x20\xa5\x12\x04\xe5\xc7\xe6\x59\x40\x1e\x1d\xa0\x02\xa6\xf3\x51\x04\x59\x96\x6f\x6a\x42\x4b\x57\xa2\x9c\xc1\x3f\x9b\x21\x1e\x8c\x87\x59\xf6\xcb\x0d\xdd\xc6\x38\xed\x7b\xeb\x57\x58\xe1\xe3\xfb\x00\x2f\xe3\x7b\xcc\x99\x86\x67\xdd\x32\x35\x3f\x75\x27\x02\x8e\x1f\x41\x6e\x09\x85\x54\x0a\x24\x3b\x2b\x0e\x88\x8c\x12\xa5\x0b\x2e\x8b\x92\x60\xed\xa5\xa7\x68\x03\xf4\xaa\x11\x30\xc2\x7b\x28\xb6\x92\x57\xd1\x51\xb6\x45\xc7\x89\xca\x5f\x9c\x71\x26\x03\xc7\x4d\x7b\x24\x35\x7e\xad\x57\x9e\x01\x73\x8c\x44\x81\xca\xd2\x12\x29\x92\x12\x1d\xf3\x9b\x2c\x27\x1a\x2a\xe5\x97\x76\x96\xd7\x8c\xfc\xa8\xe1\x1f\x3d\x44\xcb\x1a\xdc\x71\x4b\xc9\xc5\xf2\x03\xef\x24\xaf\x45\x21\x90\x6c\x6c\x7d\xde\x12\x72\xcc\xab\x0a\xb1\xa5\x1c\xe0\x1c\x3e\x12\x24\x3f\x09\xb3\x99\xe9\x55\xfd\x1c\xe6\xab\x71\x36\x6b\x59\x01\x6e\xe2\xfc\x4c\x5d\x3a\xee\xd4\x71\xb7\x6e\xa2\x22\xaf\x25\x4e\xf5\xd2\x66\x4e\x24\x77\x90\x1a\x07\xb2\x2c\xaf\x49\x99\x0e\xde\x9d\x03\xae\x78\x69\xaf\x9b\xd5\xd5\x06\xe4\xc4\x25\x6d\xcf\x9a\xfe\x5e\xaf\x7c\x6f\x1c\xed\x6b\x44\x18\xc8\x82\xa1\x2a\x26\xab\x1c\x4b\x28\x81\x69\x82\x68\xa1\x04\x60\x0b\x3e\x68\x6a\x46\x33\x79\x52\xd4\xcc\x25\xec\x88\xd2\xf2\xe8\x45\x9e\xb8\x30\x17\x56\x82\x00\x56\xaa\xa2\xeb\x01\x52\x03\x9c\x35\xc0\xd8\x10\x2c\x1a\x26\x4a\x36\x17\xb8\xbb\x61\x9a\xd0\xdd\xac\x2d\x77\x08\x0b\x05\x48\xe2\xfd\x85\xf4\xbc\x42\x84\xa5\x28\x15\x98\x96\x47\xc1\x49\x17\xc6\xde\x5d\x7c\x02\x76\x28\x46\xbb\x39\x5b\x0c\xc0\x0e\x44\x72\x56\x0d\x41\x3a\x2d\x81\x1a\xf4\xcf\x82\x2b\xb8\x3e\x38\xf6\x14\x0f\x03\xe3\x37\xa3\x4f\xaf\x6d\xe9\xe5\x5b\x2e\x2b\xd4\x2c\x76\x98\xdb\xf4\x61\x6b\xaa\xa9\xe5\x99\x02\x34\x79\x68\x0a\x5f\x44\x0b\x4a\xd8\xe3\xf2\x26\x0e\xcf\x5a\xa2\x62\xcf\x95\xbe\xa4\x46\xc9\xf7\x80\xa8\xde\xe3\x3d\xe0\xc7\x19\x72\x13\x65\x51\x73\xa5\x53\x8c\x9c\x54\x68\x17\x07\x09\x1c\x83\x5c\x5c\x8b\xe5\x8b\x0a\xdf\x18\x96\xef\x76\x0d\x34\x64\x71\x93\xda\xbe\x7f\x1d\xab\x8a\x4b\x49\x0e\x20\x53\x4b\x5c\x2e\x4e\x2d\x89\xfb\x32\x25\x9b\x47\xfb\x33\x0b\xfa\xed\xae\x6b\xcf\x66\xbc\xaa\xfd\x8f\xd2\x7c\x3d\x4d\x99\xd3\xa4\xe9\x3e\x71\x38\x4c\xab\x73\x2d\xad\x54\x08\x37\xe5\xac\x04\x15\xd0\xeb\x09\xda\x6f\x78\x14\x93\x9c\x7f\xc2\x4e\xc0\x93\xc4\x1a\x8a\xd4\x67\x27\xc2\xec\xa2\x0e\x2b\x49\x75\xd1\x16\x3b\xc2\x4d\x68\x79\xa9\xcb\x3c\x2d\x37\x6e\x62\x2d\x0e\x51\x82\x14\xc4\x9d\x3d\x28\x48\x6b\x34\x22\x0e\x5f\x12\x6d\xc2\x47\xfb\xd7\x59\xda\x00\x69\x70\xcc\xf4\xd6\x2d\x32\x94\x59\xa2\x52\xea\x5d\xc8\x3a\x5e\xb4\xbe\x66\x67\x29\xec\xc2\xdb\x8e\x15\x6d\x84\x30\x1d\x4c\x70\xa9\x7f\x4b\x2f\x74\x8a\x53\xa7\x84\xdf\x4d\x3e\x6d\x8f\x5c\x75\x27\x11\xbd\x4e\x4f\x35\x13\xa5\x3c\x68\x4f\x47\x45\x98\x86\x5d\xd3\xca\xf8\x93\x40\xbd\xa1\x44\xed\xa1\x3c\x87\x46\x72\xcd\x31\xa7\x69\x8e\xe1\xdd\xa0\x49\x77\x86\x99\xfe\xea\xa2\xda\x4c\x48\x72\x20\x14\x76\x0e\xc7\x1b\xce\x29\x20\x66\x25\x0a\x09\xa8\x2c\x38\xa3\xc7\x04\xa4\xd2\x48\x46\x77\x25\x14\xe0\x5a\x12\x7d\x2c\xb8\xd0\x8b\x57\x85\x6a\x5f\x15\x8a\xfc\x04\xdb\xf7\x4e\x56\xdf\x0f\xb4\x76\x16\xe4\x6c\x71\x67\x7f\xb6\x22\xfe\x6f\xb6\x22\xd4\x51\x61\x7d\x59\x6d\xad\x74\x49\x58\xc1\x05\xb0\xa8\x6f\x28\xcd\x45\xb1\x93\x08\x43\x21\x40\x12\xee\x15\x85\x15\x60\xcb\x5a\xa2\x66\xfe\xe9\x30\x8a\xec\x18\xf2\xc7\x1d\x03\xaa\x2b\xb1\xbd\x70\x13\x40\xeb\xb8\xb3\xd7\x94\x54\x24\xec\x34\x1e\xab\x4d\xa8\xd7\xba\x5a\xcd\x5f\xa2\xcd\x94\x67\x49\x21\x7b\xa6\x43\x98\x6f\x10\x12\x3a\x83\x3d\x92\x67\xa4\x8e\xd6\x31\xb7\x81\xfc\xe4\xeb\x1b\xbc\xeb\xb2\x0e\xab\xdb\xf1\x6e\xfa\x85\xac\xbd\xf8\xb3\x4a\x2f\x77\x19\xeb\x60\xf5\xe3\x77\xaa\x5a\x45\x9b\xb8\x16\xc3\xd4\x5c\x03\x32\x42\xa7\xa7\xae\xd9\x7f\x45\x84\xb6\x74\xd4\xc2\x3d\xba\x49\x88\xe3\xfd\x4c\x89\xb1\xf3\xb5\xa3\x7e\x72\x45\x60\xd0\x60\xce\x14\x51\x1a\x18\xf6\xef\xaf\x7a\x89\x36\x64\x72\x78\x31\x15\xca\x7c\xdf\x95\xd6\x75\xb5\x28\xb4\xeb\xe2\x6d\x72\xa3\x93\xee\xab\xfd\x81\xfc\x6f\x61\x85\x71\xcc\x45\x40\x35\xe9\x6c\x9c\x9b\x66\x9d\xad\x8b\x99\x3a\x34\x14\x32\x9e\xb8\x7c\x6c\x12\x52\x49\xfc\x91\x63\xe5\x90\x9c\x71\xa4\xef\xec\xf5\x0d\x03\xf8\xce\xaa\x4d\x68\xf4\x6c\x7f\xfe\xdc\xbc\x07\x05\xcf\xb4\x89\x42\x1b\xe7\x5c\xc2\x97\x68\x9b\xcc\x20\x0f\xf1\x7c\x2f\x41\x4b\xe2\x1c\x25\x0c\x45\x93\x99\xdb\x41\xbd\xcf\x0d\x77\x4d\x2a\xe0\xb5\x3f\x0c\xad\x4c\xc3\xe9\x89\x72\xe3\xcc\x3f\xa2\x54\x03\xe9\xea\xf4\xc1\x38\x40\xea\xfa\xf2\xa8\xe2\x52\x12\x16\xb0\xb2\x3d\xda\x48\xca\x6e\x12\x04\x25\x18\xa9\x58\x05\x71\xc5\x2e\x70\x2d\x4a\xa4\xa1\xe8\xaf\x8d\x9c\x53\xb3\xcd\x14\x6b\x02\x49\x44\x29\x50\xa2\xaa\x94\xe2\x27\x2f\x81\x22\x6f\xf4\x8f\xd6\xbd\x2d\xf9\x16\x11\x5a\x4b\x28\x10\x0e\x86\x69\x87\xa2\xe2\x8c\x68\xee\x0d\x27\x69\x53\x56\xe8\xb9\x18\xa6\x6d\x21\xb1\x96\xc4\xee\xc6\x53\x37\x70\x0d\x4b\xe8\x72\xf7\x79\x65\xf5\x8c\x8a\x4e\x45\x7a\xc0\x62\x86\x19\x27\xac\x4b\x50\x4d\xd8\x19\xf7\xd7\xa3\xf4\xd1\x00\xdf\x6f\x0f\x14\x82\x53\xd2\x55\x01\x4b\x70\x88\x39\xeb\x84\x9c\x62\x10\x57\x5a\x60\x63\x0e\x4d\x0f\x53\x09\x1d\x75\xd6\x96\xe0\x89\xb0\x92\x3f\x9d\x31\xe1\x72\xa6\x24\x28\xc2\xe0\x04\xc7\x6b\x05\xad\xb4\x44\x84\xe9\xb3\x8f\x93\x5c\xb1\x08\x09\x5b\x90\xc0\xa6\x86\x9e\xcd\x97\xf5\x59\xb8\xb4\x8f\xf1\x16\xe7\xb0\x47\x28\xd1\xd4\xb7\x6f\xb0\xab\x77\xad\xf2\xaf\x28\x90\x46\x2f\x8e\x24\xd2\x11\x17\x2d\x8d\x42\xc9\x13\x8b\x3a\x7a\x34\x55\x41\xc5\xe7\xaf\x61\x5c\x71\x11\x39\xc6\xe2\x00\x5b\xa0\x50\x48\x3a\xcb\xec\x51\x05\x17\xcb\x6f\xa6\xc4\xcf\x2b\xd7\xf1\xb0\x4d\x04\xaa\x96\x8a\x21\xc9\xa7\xbb\xb9\xb7\x52\xc9\xde\x41\x74\xa8\x37\x2c\xd0\x2b\xbf\xef\xe8\x60\xdf\x9c\x68\x2f\x66\x04\xb4\xfa\x30\xb6\x21\x37\xa3\xac\xd6\xc9\x2a\x0e\xde\x8a\x58\x6e\xfd\x6d\x47\xe4\xee\x80\xfa\x5a\x27\xa4\x35\xc2\xfb\xa4\x2e\xeb\xcc\xd2\xfa\x8a\x38\x34\xd9\x0b\xf0\x86\xa1\x1e\xf5\x27\x0a\xfd\x8f\xd8\xec\xef\xb3\xaf\xfe\x5b\x88\xe8\x9d\xfc\x16\x75\x71\x1e\x4f\xb8\x52\xf9\x0e\x74\xf6\xc6\xaa\x98\x24\x31\xaf\x2a\x7a\xd4\x1f\x55\xbc\xaa\x57\xd8\xa7\x5d\x86\x4a\xa6\x9b\x5f\x73\x92\x3c\xf7\x2b\x86\xb5\xbd\x0c\x17\xe6\xf9\x72\xd0\xae\x6b\xe6\xce\xc2\x07\x48\x60\xb3\xd5\x99\xb4\x17\xe2\x3c\xe7\x0b\xc6\xfd\xbb\x4f\x33\xd5\xdb\xdc\xd5\xb9\x57\x2a\x7b\x16\xb8\x67\xe0\xd7\xa9\xd3\x18\x0f\xd2\x9d\x7e\x1c\x15\xf6\xff\x81\x7e\xf2\xa9\x54\xc3\x27\x3b\x4e\x36\x67\x7f\xd9\x27\x4b\xdd\x67\x4e\x6b\x4b\x3e\x0e\xa4\xbb\x88\x6a\x24\xda\xb5\xb9\x57\x10\xbc\x39\xef\xfb\x80\xca\x3d\xd7\x1a\x3e\x64\x0a\x1c\xb5\xaf\xcc\xbf\xed\x47\x67\xab\x97\xd5\x7f\x02\x00\x00\xff\xff\x8b\xd2\x8d\x87\xde\x3b\x00\x00") + +func dataConfig_schema_v34JsonBytes() ([]byte, error) { + return bindataRead( + _dataConfig_schema_v34Json, + "data/config_schema_v3.4.json", + ) +} + +func dataConfig_schema_v34Json() (*asset, error) { + bytes, err := dataConfig_schema_v34JsonBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "data/config_schema_v3.4.json", size: 0, mode: os.FileMode(0), modTime: time.Unix(0, 0)} + a := &asset{bytes: bytes, info: info} + return a, nil +} + // Asset loads and returns the asset for the given name. // It returns an error if the asset could not be found or // could not be loaded. @@ -207,6 +228,7 @@ var _bindata = map[string]func() (*asset, error){ "data/config_schema_v3.1.json": dataConfig_schema_v31Json, "data/config_schema_v3.2.json": dataConfig_schema_v32Json, "data/config_schema_v3.3.json": dataConfig_schema_v33Json, + "data/config_schema_v3.4.json": dataConfig_schema_v34Json, } // AssetDir returns the file names below a certain @@ -254,6 +276,7 @@ var _bintree = &bintree{nil, map[string]*bintree{ "config_schema_v3.1.json": &bintree{dataConfig_schema_v31Json, map[string]*bintree{}}, "config_schema_v3.2.json": &bintree{dataConfig_schema_v32Json, map[string]*bintree{}}, "config_schema_v3.3.json": &bintree{dataConfig_schema_v33Json, map[string]*bintree{}}, + "config_schema_v3.4.json": &bintree{dataConfig_schema_v34Json, map[string]*bintree{}}, }}, }} diff --git a/cli/compose/schema/data/config_schema_v3.4.json b/cli/compose/schema/data/config_schema_v3.4.json new file mode 100644 index 0000000000..2457a2de81 --- /dev/null +++ b/cli/compose/schema/data/config_schema_v3.4.json @@ -0,0 +1,534 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "id": "config_schema_v3.4.json", + "type": "object", + "required": ["version"], + + "properties": { + "version": { + "type": "string" + }, + + "services": { + "id": "#/properties/services", + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9._-]+$": { + "$ref": "#/definitions/service" + } + }, + "additionalProperties": false + }, + + "networks": { + "id": "#/properties/networks", + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9._-]+$": { + "$ref": "#/definitions/network" + } + } + }, + + "volumes": { + "id": "#/properties/volumes", + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9._-]+$": { + "$ref": "#/definitions/volume" + } + }, + "additionalProperties": false + }, + + "secrets": { + "id": "#/properties/secrets", + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9._-]+$": { + "$ref": "#/definitions/secret" + } + }, + "additionalProperties": false + }, + + "configs": { + "id": "#/properties/configs", + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9._-]+$": { + "$ref": "#/definitions/config" + } + }, + "additionalProperties": false + } + }, + + "additionalProperties": false, + + "definitions": { + + "service": { + "id": "#/definitions/service", + "type": "object", + + "properties": { + "deploy": {"$ref": "#/definitions/deployment"}, + "build": { + "oneOf": [ + {"type": "string"}, + { + "type": "object", + "properties": { + "context": {"type": "string"}, + "dockerfile": {"type": "string"}, + "args": {"$ref": "#/definitions/list_or_dict"}, + "labels": {"$ref": "#/definitions/list_or_dict"}, + "cache_from": {"$ref": "#/definitions/list_of_strings"} + }, + "additionalProperties": false + } + ] + }, + "cap_add": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, + "cap_drop": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, + "cgroup_parent": {"type": "string"}, + "command": { + "oneOf": [ + {"type": "string"}, + {"type": "array", "items": {"type": "string"}} + ] + }, + "configs": { + "type": "array", + "items": { + "oneOf": [ + {"type": "string"}, + { + "type": "object", + "properties": { + "source": {"type": "string"}, + "target": {"type": "string"}, + "uid": {"type": "string"}, + "gid": {"type": "string"}, + "mode": {"type": "number"} + } + } + ] + } + }, + "container_name": {"type": "string"}, + "credential_spec": {"type": "object", "properties": { + "file": {"type": "string"}, + "registry": {"type": "string"} + }}, + "depends_on": {"$ref": "#/definitions/list_of_strings"}, + "devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, + "dns": {"$ref": "#/definitions/string_or_list"}, + "dns_search": {"$ref": "#/definitions/string_or_list"}, + "domainname": {"type": "string"}, + "entrypoint": { + "oneOf": [ + {"type": "string"}, + {"type": "array", "items": {"type": "string"}} + ] + }, + "env_file": {"$ref": "#/definitions/string_or_list"}, + "environment": {"$ref": "#/definitions/list_or_dict"}, + + "expose": { + "type": "array", + "items": { + "type": ["string", "number"], + "format": "expose" + }, + "uniqueItems": true + }, + + "external_links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, + "extra_hosts": {"$ref": "#/definitions/list_or_dict"}, + "healthcheck": {"$ref": "#/definitions/healthcheck"}, + "hostname": {"type": "string"}, + "image": {"type": "string"}, + "ipc": {"type": "string"}, + "labels": {"$ref": "#/definitions/list_or_dict"}, + "links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, + + "logging": { + "type": "object", + + "properties": { + "driver": {"type": "string"}, + "options": { + "type": "object", + "patternProperties": { + "^.+$": {"type": ["string", "number", "null"]} + } + } + }, + "additionalProperties": false + }, + + "mac_address": {"type": "string"}, + "network_mode": {"type": "string"}, + + "networks": { + "oneOf": [ + {"$ref": "#/definitions/list_of_strings"}, + { + "type": "object", + "patternProperties": { + "^[a-zA-Z0-9._-]+$": { + "oneOf": [ + { + "type": "object", + "properties": { + "aliases": {"$ref": "#/definitions/list_of_strings"}, + "ipv4_address": {"type": "string"}, + "ipv6_address": {"type": "string"} + }, + "additionalProperties": false + }, + {"type": "null"} + ] + } + }, + "additionalProperties": false + } + ] + }, + "pid": {"type": ["string", "null"]}, + + "ports": { + "type": "array", + "items": { + "oneOf": [ + {"type": "number", "format": "ports"}, + {"type": "string", "format": "ports"}, + { + "type": "object", + "properties": { + "mode": {"type": "string"}, + "target": {"type": "integer"}, + "published": {"type": "integer"}, + "protocol": {"type": "string"} + }, + "additionalProperties": false + } + ] + }, + "uniqueItems": true + }, + + "privileged": {"type": "boolean"}, + "read_only": {"type": "boolean"}, + "restart": {"type": "string"}, + "security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, + "shm_size": {"type": ["number", "string"]}, + "secrets": { + "type": "array", + "items": { + "oneOf": [ + {"type": "string"}, + { + "type": "object", + "properties": { + "source": {"type": "string"}, + "target": {"type": "string"}, + "uid": {"type": "string"}, + "gid": {"type": "string"}, + "mode": {"type": "number"} + } + } + ] + } + }, + "sysctls": {"$ref": "#/definitions/list_or_dict"}, + "stdin_open": {"type": "boolean"}, + "stop_grace_period": {"type": "string", "format": "duration"}, + "stop_signal": {"type": "string"}, + "tmpfs": {"$ref": "#/definitions/string_or_list"}, + "tty": {"type": "boolean"}, + "ulimits": { + "type": "object", + "patternProperties": { + "^[a-z]+$": { + "oneOf": [ + {"type": "integer"}, + { + "type":"object", + "properties": { + "hard": {"type": "integer"}, + "soft": {"type": "integer"} + }, + "required": ["soft", "hard"], + "additionalProperties": false + } + ] + } + } + }, + "user": {"type": "string"}, + "userns_mode": {"type": "string"}, + "volumes": { + "type": "array", + "items": { + "oneOf": [ + {"type": "string"}, + { + "type": "object", + "required": ["type"], + "properties": { + "type": {"type": "string"}, + "source": {"type": "string"}, + "target": {"type": "string"}, + "read_only": {"type": "boolean"}, + "consistency": {"type": "string"}, + "bind": { + "type": "object", + "properties": { + "propagation": {"type": "string"} + } + }, + "volume": { + "type": "object", + "properties": { + "nocopy": {"type": "boolean"} + } + } + } + } + ], + "uniqueItems": true + } + }, + "working_dir": {"type": "string"} + }, + "additionalProperties": false + }, + + "healthcheck": { + "id": "#/definitions/healthcheck", + "type": "object", + "additionalProperties": false, + "properties": { + "disable": {"type": "boolean"}, + "interval": {"type": "string"}, + "retries": {"type": "number"}, + "test": { + "oneOf": [ + {"type": "string"}, + {"type": "array", "items": {"type": "string"}} + ] + }, + "timeout": {"type": "string"} + } + }, + "deployment": { + "id": "#/definitions/deployment", + "type": ["object", "null"], + "properties": { + "mode": {"type": "string"}, + "endpoint_mode": {"type": "string"}, + "replicas": {"type": "integer"}, + "labels": {"$ref": "#/definitions/list_or_dict"}, + "update_config": { + "type": "object", + "properties": { + "parallelism": {"type": "integer"}, + "delay": {"type": "string", "format": "duration"}, + "failure_action": {"type": "string"}, + "monitor": {"type": "string", "format": "duration"}, + "max_failure_ratio": {"type": "number"} + }, + "additionalProperties": false + }, + "resources": { + "type": "object", + "properties": { + "limits": {"$ref": "#/definitions/resource"}, + "reservations": {"$ref": "#/definitions/resource"} + } + }, + "restart_policy": { + "type": "object", + "properties": { + "condition": {"type": "string"}, + "delay": {"type": "string", "format": "duration"}, + "max_attempts": {"type": "integer"}, + "window": {"type": "string", "format": "duration"} + }, + "additionalProperties": false + }, + "placement": { + "type": "object", + "properties": { + "constraints": {"type": "array", "items": {"type": "string"}}, + "preferences": { + "type": "array", + "items": { + "type": "object", + "properties": { + "spread": {"type": "string"} + }, + "additionalProperties": false + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + + "resource": { + "id": "#/definitions/resource", + "type": "object", + "properties": { + "cpus": {"type": "string"}, + "memory": {"type": "string"} + }, + "additionalProperties": false + }, + + "network": { + "id": "#/definitions/network", + "type": ["object", "null"], + "properties": { + "driver": {"type": "string"}, + "driver_opts": { + "type": "object", + "patternProperties": { + "^.+$": {"type": ["string", "number"]} + } + }, + "ipam": { + "type": "object", + "properties": { + "driver": {"type": "string"}, + "config": { + "type": "array", + "items": { + "type": "object", + "properties": { + "subnet": {"type": "string"} + }, + "additionalProperties": false + } + } + }, + "additionalProperties": false + }, + "external": { + "type": ["boolean", "object"], + "properties": { + "name": {"type": "string"} + }, + "additionalProperties": false + }, + "internal": {"type": "boolean"}, + "attachable": {"type": "boolean"}, + "labels": {"$ref": "#/definitions/list_or_dict"} + }, + "additionalProperties": false + }, + + "volume": { + "id": "#/definitions/volume", + "type": ["object", "null"], + "properties": { + "driver": {"type": "string"}, + "driver_opts": { + "type": "object", + "patternProperties": { + "^.+$": {"type": ["string", "number"]} + } + }, + "external": { + "type": ["boolean", "object"], + "properties": { + "name": {"type": "string"} + }, + "additionalProperties": false + }, + "labels": {"$ref": "#/definitions/list_or_dict"} + }, + "additionalProperties": false + }, + + "secret": { + "id": "#/definitions/secret", + "type": "object", + "properties": { + "file": {"type": "string"}, + "external": { + "type": ["boolean", "object"], + "properties": { + "name": {"type": "string"} + } + }, + "labels": {"$ref": "#/definitions/list_or_dict"} + }, + "additionalProperties": false + }, + + "config": { + "id": "#/definitions/config", + "type": "object", + "properties": { + "file": {"type": "string"}, + "external": { + "type": ["boolean", "object"], + "properties": { + "name": {"type": "string"} + } + }, + "labels": {"$ref": "#/definitions/list_or_dict"} + }, + "additionalProperties": false + }, + + "string_or_list": { + "oneOf": [ + {"type": "string"}, + {"$ref": "#/definitions/list_of_strings"} + ] + }, + + "list_of_strings": { + "type": "array", + "items": {"type": "string"}, + "uniqueItems": true + }, + + "list_or_dict": { + "oneOf": [ + { + "type": "object", + "patternProperties": { + ".+": { + "type": ["string", "number", "null"] + } + }, + "additionalProperties": false + }, + {"type": "array", "items": {"type": "string"}, "uniqueItems": true} + ] + }, + + "constraints": { + "service": { + "id": "#/definitions/constraints/service", + "anyOf": [ + {"required": ["build"]}, + {"required": ["image"]} + ], + "properties": { + "build": { + "required": ["context"] + } + } + } + } + } +}