github.com/bdwilliams/libcompose@v0.3.1-0.20160826154243-d81a9bdacff0/script/config_schema_v1.json (about) 1 { 2 "$schema": "http://json-schema.org/draft-04/schema#", 3 "id": "config_schema_v1.json", 4 5 "type": "object", 6 7 "patternProperties": { 8 "^[a-zA-Z0-9._-]+$": { 9 "$ref": "#/definitions/service" 10 } 11 }, 12 13 "additionalProperties": false, 14 15 "definitions": { 16 "service": { 17 "id": "#/definitions/service", 18 "type": "object", 19 20 "properties": { 21 "build": {"type": "string"}, 22 "cap_add": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, 23 "cap_drop": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, 24 "cgroup_parent": {"type": "string"}, 25 "command": { 26 "oneOf": [ 27 {"type": "string"}, 28 {"type": "array", "items": {"type": "string"}} 29 ] 30 }, 31 "container_name": {"type": "string"}, 32 "cpu_shares": {"type": ["number", "string"]}, 33 "cpu_quota": {"type": ["number", "string"]}, 34 "cpuset": {"type": "string"}, 35 "devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, 36 "dns": {"$ref": "#/definitions/string_or_list"}, 37 "dns_search": {"$ref": "#/definitions/string_or_list"}, 38 "dockerfile": {"type": "string"}, 39 "domainname": {"type": "string"}, 40 "entrypoint": { 41 "oneOf": [ 42 {"type": "string"}, 43 {"type": "array", "items": {"type": "string"}} 44 ] 45 }, 46 "env_file": {"$ref": "#/definitions/string_or_list"}, 47 "environment": {"$ref": "#/definitions/list_or_dict"}, 48 49 "expose": { 50 "type": "array", 51 "items": { 52 "type": ["string", "number"], 53 "format": "expose" 54 }, 55 "uniqueItems": true 56 }, 57 58 "extends": { 59 "oneOf": [ 60 { 61 "type": "string" 62 }, 63 { 64 "type": "object", 65 66 "properties": { 67 "service": {"type": "string"}, 68 "file": {"type": "string"} 69 }, 70 "required": ["service"], 71 "additionalProperties": false 72 } 73 ] 74 }, 75 76 "extra_hosts": {"$ref": "#/definitions/list_or_dict"}, 77 "external_links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, 78 "hostname": {"type": "string"}, 79 "image": {"type": "string"}, 80 "ipc": {"type": "string"}, 81 "labels": {"$ref": "#/definitions/list_or_dict"}, 82 "links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, 83 "log_driver": {"type": "string"}, 84 "log_opt": {"type": "object"}, 85 "mac_address": {"type": "string"}, 86 "mem_limit": {"type": ["number", "string"]}, 87 "memswap_limit": {"type": ["number", "string"]}, 88 "net": {"type": "string"}, 89 "pid": {"type": ["string", "null"]}, 90 91 "ports": { 92 "type": "array", 93 "items": { 94 "type": ["string", "number"], 95 "format": "ports" 96 }, 97 "uniqueItems": true 98 }, 99 100 "privileged": {"type": "boolean"}, 101 "read_only": {"type": "boolean"}, 102 "restart": {"type": "string"}, 103 "security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, 104 "shm_size": {"type": ["number", "string"]}, 105 "stdin_open": {"type": "boolean"}, 106 "stop_signal": {"type": "string"}, 107 "tty": {"type": "boolean"}, 108 "ulimits": { 109 "type": "object", 110 "patternProperties": { 111 "^[a-z]+$": { 112 "oneOf": [ 113 {"type": "integer"}, 114 { 115 "type":"object", 116 "properties": { 117 "hard": {"type": "integer"}, 118 "soft": {"type": "integer"} 119 }, 120 "required": ["soft", "hard"], 121 "additionalProperties": false 122 } 123 ] 124 } 125 } 126 }, 127 "user": {"type": "string"}, 128 "volumes": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, 129 "volume_driver": {"type": "string"}, 130 "volumes_from": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, 131 "working_dir": {"type": "string"} 132 }, 133 134 "dependencies": { 135 "memswap_limit": ["mem_limit"] 136 }, 137 "additionalProperties": false 138 }, 139 140 "string_or_list": { 141 "oneOf": [ 142 {"type": "string"}, 143 {"$ref": "#/definitions/list_of_strings"} 144 ] 145 }, 146 147 "list_of_strings": { 148 "type": "array", 149 "items": {"type": "string"}, 150 "uniqueItems": true 151 }, 152 153 "list_or_dict": { 154 "oneOf": [ 155 { 156 "type": "object", 157 "patternProperties": { 158 ".+": { 159 "type": ["string", "number", "null"] 160 } 161 }, 162 "additionalProperties": false 163 }, 164 {"type": "array", "items": {"type": "string"}, "uniqueItems": true} 165 ] 166 }, 167 168 "constraints": { 169 "service": { 170 "id": "#/definitions/constraints/service", 171 "anyOf": [ 172 { 173 "required": ["build"], 174 "not": {"required": ["image"]} 175 }, 176 { 177 "required": ["image"], 178 "not": {"anyOf": [ 179 {"required": ["build"]}, 180 {"required": ["dockerfile"]} 181 ]} 182 } 183 ] 184 } 185 } 186 } 187 }