github.com/flavio/docker@v0.1.3-0.20170117145210-f63d1a6eec47/cli/compose/schema/data/config_schema_v3.0.json (about) 1 { 2 "$schema": "http://json-schema.org/draft-04/schema#", 3 "id": "config_schema_v3.0.json", 4 "type": "object", 5 "required": ["version"], 6 7 "properties": { 8 "version": { 9 "type": "string" 10 }, 11 12 "services": { 13 "id": "#/properties/services", 14 "type": "object", 15 "patternProperties": { 16 "^[a-zA-Z0-9._-]+$": { 17 "$ref": "#/definitions/service" 18 } 19 }, 20 "additionalProperties": false 21 }, 22 23 "networks": { 24 "id": "#/properties/networks", 25 "type": "object", 26 "patternProperties": { 27 "^[a-zA-Z0-9._-]+$": { 28 "$ref": "#/definitions/network" 29 } 30 } 31 }, 32 33 "volumes": { 34 "id": "#/properties/volumes", 35 "type": "object", 36 "patternProperties": { 37 "^[a-zA-Z0-9._-]+$": { 38 "$ref": "#/definitions/volume" 39 } 40 }, 41 "additionalProperties": false 42 } 43 }, 44 45 "additionalProperties": false, 46 47 "definitions": { 48 49 "service": { 50 "id": "#/definitions/service", 51 "type": "object", 52 53 "properties": { 54 "deploy": {"$ref": "#/definitions/deployment"}, 55 "build": { 56 "oneOf": [ 57 {"type": "string"}, 58 { 59 "type": "object", 60 "properties": { 61 "context": {"type": "string"}, 62 "dockerfile": {"type": "string"}, 63 "args": {"$ref": "#/definitions/list_or_dict"} 64 }, 65 "additionalProperties": false 66 } 67 ] 68 }, 69 "cap_add": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, 70 "cap_drop": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, 71 "cgroup_parent": {"type": "string"}, 72 "command": { 73 "oneOf": [ 74 {"type": "string"}, 75 {"type": "array", "items": {"type": "string"}} 76 ] 77 }, 78 "container_name": {"type": "string"}, 79 "depends_on": {"$ref": "#/definitions/list_of_strings"}, 80 "devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, 81 "dns": {"$ref": "#/definitions/string_or_list"}, 82 "dns_search": {"$ref": "#/definitions/string_or_list"}, 83 "domainname": {"type": "string"}, 84 "entrypoint": { 85 "oneOf": [ 86 {"type": "string"}, 87 {"type": "array", "items": {"type": "string"}} 88 ] 89 }, 90 "env_file": {"$ref": "#/definitions/string_or_list"}, 91 "environment": {"$ref": "#/definitions/list_or_dict"}, 92 93 "expose": { 94 "type": "array", 95 "items": { 96 "type": ["string", "number"], 97 "format": "expose" 98 }, 99 "uniqueItems": true 100 }, 101 102 "external_links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, 103 "extra_hosts": {"$ref": "#/definitions/list_or_dict"}, 104 "healthcheck": {"$ref": "#/definitions/healthcheck"}, 105 "hostname": {"type": "string"}, 106 "image": {"type": "string"}, 107 "ipc": {"type": "string"}, 108 "labels": {"$ref": "#/definitions/list_or_dict"}, 109 "links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, 110 111 "logging": { 112 "type": "object", 113 114 "properties": { 115 "driver": {"type": "string"}, 116 "options": { 117 "type": "object", 118 "patternProperties": { 119 "^.+$": {"type": ["string", "number", "null"]} 120 } 121 } 122 }, 123 "additionalProperties": false 124 }, 125 126 "mac_address": {"type": "string"}, 127 "network_mode": {"type": "string"}, 128 129 "networks": { 130 "oneOf": [ 131 {"$ref": "#/definitions/list_of_strings"}, 132 { 133 "type": "object", 134 "patternProperties": { 135 "^[a-zA-Z0-9._-]+$": { 136 "oneOf": [ 137 { 138 "type": "object", 139 "properties": { 140 "aliases": {"$ref": "#/definitions/list_of_strings"}, 141 "ipv4_address": {"type": "string"}, 142 "ipv6_address": {"type": "string"} 143 }, 144 "additionalProperties": false 145 }, 146 {"type": "null"} 147 ] 148 } 149 }, 150 "additionalProperties": false 151 } 152 ] 153 }, 154 "pid": {"type": ["string", "null"]}, 155 156 "ports": { 157 "type": "array", 158 "items": { 159 "type": ["string", "number"], 160 "format": "ports" 161 }, 162 "uniqueItems": true 163 }, 164 165 "privileged": {"type": "boolean"}, 166 "read_only": {"type": "boolean"}, 167 "restart": {"type": "string"}, 168 "security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, 169 "shm_size": {"type": ["number", "string"]}, 170 "stdin_open": {"type": "boolean"}, 171 "stop_signal": {"type": "string"}, 172 "stop_grace_period": {"type": "string", "format": "duration"}, 173 "tmpfs": {"$ref": "#/definitions/string_or_list"}, 174 "tty": {"type": "boolean"}, 175 "ulimits": { 176 "type": "object", 177 "patternProperties": { 178 "^[a-z]+$": { 179 "oneOf": [ 180 {"type": "integer"}, 181 { 182 "type":"object", 183 "properties": { 184 "hard": {"type": "integer"}, 185 "soft": {"type": "integer"} 186 }, 187 "required": ["soft", "hard"], 188 "additionalProperties": false 189 } 190 ] 191 } 192 } 193 }, 194 "user": {"type": "string"}, 195 "volumes": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, 196 "working_dir": {"type": "string"} 197 }, 198 "additionalProperties": false 199 }, 200 201 "healthcheck": { 202 "id": "#/definitions/healthcheck", 203 "type": ["object", "null"], 204 "properties": { 205 "interval": {"type":"string"}, 206 "timeout": {"type":"string"}, 207 "retries": {"type": "number"}, 208 "test": { 209 "oneOf": [ 210 {"type": "string"}, 211 {"type": "array", "items": {"type": "string"}} 212 ] 213 }, 214 "disable": {"type": "boolean"} 215 }, 216 "additionalProperties": false 217 }, 218 "deployment": { 219 "id": "#/definitions/deployment", 220 "type": ["object", "null"], 221 "properties": { 222 "mode": {"type": "string"}, 223 "replicas": {"type": "integer"}, 224 "labels": {"$ref": "#/definitions/list_or_dict"}, 225 "update_config": { 226 "type": "object", 227 "properties": { 228 "parallelism": {"type": "integer"}, 229 "delay": {"type": "string", "format": "duration"}, 230 "failure_action": {"type": "string"}, 231 "monitor": {"type": "string", "format": "duration"}, 232 "max_failure_ratio": {"type": "number"} 233 }, 234 "additionalProperties": false 235 }, 236 "resources": { 237 "type": "object", 238 "properties": { 239 "limits": {"$ref": "#/definitions/resource"}, 240 "reservations": {"$ref": "#/definitions/resource"} 241 } 242 }, 243 "restart_policy": { 244 "type": "object", 245 "properties": { 246 "condition": {"type": "string"}, 247 "delay": {"type": "string", "format": "duration"}, 248 "max_attempts": {"type": "integer"}, 249 "window": {"type": "string", "format": "duration"} 250 }, 251 "additionalProperties": false 252 }, 253 "placement": { 254 "type": "object", 255 "properties": { 256 "constraints": {"type": "array", "items": {"type": "string"}} 257 }, 258 "additionalProperties": false 259 } 260 }, 261 "additionalProperties": false 262 }, 263 264 "resource": { 265 "id": "#/definitions/resource", 266 "type": "object", 267 "properties": { 268 "cpus": {"type": "string"}, 269 "memory": {"type": "string"} 270 }, 271 "additionalProperties": false 272 }, 273 274 "network": { 275 "id": "#/definitions/network", 276 "type": ["object", "null"], 277 "properties": { 278 "driver": {"type": "string"}, 279 "driver_opts": { 280 "type": "object", 281 "patternProperties": { 282 "^.+$": {"type": ["string", "number"]} 283 } 284 }, 285 "ipam": { 286 "type": "object", 287 "properties": { 288 "driver": {"type": "string"}, 289 "config": { 290 "type": "array", 291 "items": { 292 "type": "object", 293 "properties": { 294 "subnet": {"type": "string"} 295 }, 296 "additionalProperties": false 297 } 298 } 299 }, 300 "additionalProperties": false 301 }, 302 "external": { 303 "type": ["boolean", "object"], 304 "properties": { 305 "name": {"type": "string"} 306 }, 307 "additionalProperties": false 308 }, 309 "labels": {"$ref": "#/definitions/list_or_dict"} 310 }, 311 "additionalProperties": false 312 }, 313 314 "volume": { 315 "id": "#/definitions/volume", 316 "type": ["object", "null"], 317 "properties": { 318 "driver": {"type": "string"}, 319 "driver_opts": { 320 "type": "object", 321 "patternProperties": { 322 "^.+$": {"type": ["string", "number"]} 323 } 324 }, 325 "external": { 326 "type": ["boolean", "object"], 327 "properties": { 328 "name": {"type": "string"} 329 } 330 } 331 }, 332 "labels": {"$ref": "#/definitions/list_or_dict"}, 333 "additionalProperties": false 334 }, 335 336 "string_or_list": { 337 "oneOf": [ 338 {"type": "string"}, 339 {"$ref": "#/definitions/list_of_strings"} 340 ] 341 }, 342 343 "list_of_strings": { 344 "type": "array", 345 "items": {"type": "string"}, 346 "uniqueItems": true 347 }, 348 349 "list_or_dict": { 350 "oneOf": [ 351 { 352 "type": "object", 353 "patternProperties": { 354 ".+": { 355 "type": ["string", "number", "null"] 356 } 357 }, 358 "additionalProperties": false 359 }, 360 {"type": "array", "items": {"type": "string"}, "uniqueItems": true} 361 ] 362 }, 363 364 "constraints": { 365 "service": { 366 "id": "#/definitions/constraints/service", 367 "anyOf": [ 368 {"required": ["build"]}, 369 {"required": ["image"]} 370 ], 371 "properties": { 372 "build": { 373 "required": ["context"] 374 } 375 } 376 } 377 } 378 } 379 }