github.com/AliyunContainerService/cli@v0.0.0-20181009023821-814ced4b30d0/cli/compose/schema/data/config_schema_v3.5.json (about) 1 { 2 "$schema": "http://json-schema.org/draft-04/schema#", 3 "id": "config_schema_v3.5.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 "secrets": { 45 "id": "#/properties/secrets", 46 "type": "object", 47 "patternProperties": { 48 "^[a-zA-Z0-9._-]+$": { 49 "$ref": "#/definitions/secret" 50 } 51 }, 52 "additionalProperties": false 53 }, 54 55 "configs": { 56 "id": "#/properties/configs", 57 "type": "object", 58 "patternProperties": { 59 "^[a-zA-Z0-9._-]+$": { 60 "$ref": "#/definitions/config" 61 } 62 }, 63 "additionalProperties": false 64 } 65 }, 66 67 "patternProperties": {"^x-": {}}, 68 "additionalProperties": false, 69 70 "definitions": { 71 72 "service": { 73 "id": "#/definitions/service", 74 "type": "object", 75 76 "properties": { 77 "deploy": {"$ref": "#/definitions/deployment"}, 78 "build": { 79 "oneOf": [ 80 {"type": "string"}, 81 { 82 "type": "object", 83 "properties": { 84 "context": {"type": "string"}, 85 "dockerfile": {"type": "string"}, 86 "args": {"$ref": "#/definitions/list_or_dict"}, 87 "labels": {"$ref": "#/definitions/list_or_dict"}, 88 "cache_from": {"$ref": "#/definitions/list_of_strings"}, 89 "network": {"type": "string"}, 90 "target": {"type": "string"}, 91 "shm_size": {"type": ["integer", "string"]} 92 }, 93 "additionalProperties": false 94 } 95 ] 96 }, 97 "cap_add": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, 98 "cap_drop": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, 99 "cgroup_parent": {"type": "string"}, 100 "command": { 101 "oneOf": [ 102 {"type": "string"}, 103 {"type": "array", "items": {"type": "string"}} 104 ] 105 }, 106 "configs": { 107 "type": "array", 108 "items": { 109 "oneOf": [ 110 {"type": "string"}, 111 { 112 "type": "object", 113 "properties": { 114 "source": {"type": "string"}, 115 "target": {"type": "string"}, 116 "uid": {"type": "string"}, 117 "gid": {"type": "string"}, 118 "mode": {"type": "number"} 119 } 120 } 121 ] 122 } 123 }, 124 "container_name": {"type": "string"}, 125 "credential_spec": {"type": "object", "properties": { 126 "file": {"type": "string"}, 127 "registry": {"type": "string"} 128 }}, 129 "depends_on": {"$ref": "#/definitions/list_of_strings"}, 130 "devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, 131 "dns": {"$ref": "#/definitions/string_or_list"}, 132 "dns_search": {"$ref": "#/definitions/string_or_list"}, 133 "domainname": {"type": "string"}, 134 "entrypoint": { 135 "oneOf": [ 136 {"type": "string"}, 137 {"type": "array", "items": {"type": "string"}} 138 ] 139 }, 140 "env_file": {"$ref": "#/definitions/string_or_list"}, 141 "environment": {"$ref": "#/definitions/list_or_dict"}, 142 143 "expose": { 144 "type": "array", 145 "items": { 146 "type": ["string", "number"], 147 "format": "expose" 148 }, 149 "uniqueItems": true 150 }, 151 152 "external_links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, 153 "extra_hosts": {"$ref": "#/definitions/list_or_dict"}, 154 "healthcheck": {"$ref": "#/definitions/healthcheck"}, 155 "hostname": {"type": "string"}, 156 "image": {"type": "string"}, 157 "ipc": {"type": "string"}, 158 "isolation": {"type": "string"}, 159 "labels": {"$ref": "#/definitions/list_or_dict"}, 160 "links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, 161 162 "logging": { 163 "type": "object", 164 165 "properties": { 166 "driver": {"type": "string"}, 167 "options": { 168 "type": "object", 169 "patternProperties": { 170 "^.+$": {"type": ["string", "number", "null"]} 171 } 172 } 173 }, 174 "additionalProperties": false 175 }, 176 177 "mac_address": {"type": "string"}, 178 "network_mode": {"type": "string"}, 179 180 "networks": { 181 "oneOf": [ 182 {"$ref": "#/definitions/list_of_strings"}, 183 { 184 "type": "object", 185 "patternProperties": { 186 "^[a-zA-Z0-9._-]+$": { 187 "oneOf": [ 188 { 189 "type": "object", 190 "properties": { 191 "aliases": {"$ref": "#/definitions/list_of_strings"}, 192 "ipv4_address": {"type": "string"}, 193 "ipv6_address": {"type": "string"} 194 }, 195 "additionalProperties": false 196 }, 197 {"type": "null"} 198 ] 199 } 200 }, 201 "additionalProperties": false 202 } 203 ] 204 }, 205 "pid": {"type": ["string", "null"]}, 206 207 "ports": { 208 "type": "array", 209 "items": { 210 "oneOf": [ 211 {"type": "number", "format": "ports"}, 212 {"type": "string", "format": "ports"}, 213 { 214 "type": "object", 215 "properties": { 216 "mode": {"type": "string"}, 217 "target": {"type": "integer"}, 218 "published": {"type": "integer"}, 219 "protocol": {"type": "string"} 220 }, 221 "additionalProperties": false 222 } 223 ] 224 }, 225 "uniqueItems": true 226 }, 227 228 "privileged": {"type": "boolean"}, 229 "read_only": {"type": "boolean"}, 230 "restart": {"type": "string"}, 231 "security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, 232 "shm_size": {"type": ["number", "string"]}, 233 "secrets": { 234 "type": "array", 235 "items": { 236 "oneOf": [ 237 {"type": "string"}, 238 { 239 "type": "object", 240 "properties": { 241 "source": {"type": "string"}, 242 "target": {"type": "string"}, 243 "uid": {"type": "string"}, 244 "gid": {"type": "string"}, 245 "mode": {"type": "number"} 246 } 247 } 248 ] 249 } 250 }, 251 "sysctls": {"$ref": "#/definitions/list_or_dict"}, 252 "stdin_open": {"type": "boolean"}, 253 "stop_grace_period": {"type": "string", "format": "duration"}, 254 "stop_signal": {"type": "string"}, 255 "tmpfs": {"$ref": "#/definitions/string_or_list"}, 256 "tty": {"type": "boolean"}, 257 "ulimits": { 258 "type": "object", 259 "patternProperties": { 260 "^[a-z]+$": { 261 "oneOf": [ 262 {"type": "integer"}, 263 { 264 "type":"object", 265 "properties": { 266 "hard": {"type": "integer"}, 267 "soft": {"type": "integer"} 268 }, 269 "required": ["soft", "hard"], 270 "additionalProperties": false 271 } 272 ] 273 } 274 } 275 }, 276 "user": {"type": "string"}, 277 "userns_mode": {"type": "string"}, 278 "volumes": { 279 "type": "array", 280 "items": { 281 "oneOf": [ 282 {"type": "string"}, 283 { 284 "type": "object", 285 "required": ["type"], 286 "properties": { 287 "type": {"type": "string"}, 288 "source": {"type": "string"}, 289 "target": {"type": "string"}, 290 "read_only": {"type": "boolean"}, 291 "consistency": {"type": "string"}, 292 "bind": { 293 "type": "object", 294 "properties": { 295 "propagation": {"type": "string"} 296 } 297 }, 298 "volume": { 299 "type": "object", 300 "properties": { 301 "nocopy": {"type": "boolean"} 302 } 303 } 304 }, 305 "additionalProperties": false 306 } 307 ], 308 "uniqueItems": true 309 } 310 }, 311 "working_dir": {"type": "string"} 312 }, 313 "additionalProperties": false 314 }, 315 316 "healthcheck": { 317 "id": "#/definitions/healthcheck", 318 "type": "object", 319 "additionalProperties": false, 320 "properties": { 321 "disable": {"type": "boolean"}, 322 "interval": {"type": "string", "format": "duration"}, 323 "retries": {"type": "number"}, 324 "test": { 325 "oneOf": [ 326 {"type": "string"}, 327 {"type": "array", "items": {"type": "string"}} 328 ] 329 }, 330 "timeout": {"type": "string", "format": "duration"}, 331 "start_period": {"type": "string", "format": "duration"} 332 } 333 }, 334 "deployment": { 335 "id": "#/definitions/deployment", 336 "type": ["object", "null"], 337 "properties": { 338 "mode": {"type": "string"}, 339 "endpoint_mode": {"type": "string"}, 340 "replicas": {"type": "integer"}, 341 "labels": {"$ref": "#/definitions/list_or_dict"}, 342 "update_config": { 343 "type": "object", 344 "properties": { 345 "parallelism": {"type": "integer"}, 346 "delay": {"type": "string", "format": "duration"}, 347 "failure_action": {"type": "string"}, 348 "monitor": {"type": "string", "format": "duration"}, 349 "max_failure_ratio": {"type": "number"}, 350 "order": {"type": "string", "enum": [ 351 "start-first", "stop-first" 352 ]} 353 }, 354 "additionalProperties": false 355 }, 356 "resources": { 357 "type": "object", 358 "properties": { 359 "limits": { 360 "type": "object", 361 "properties": { 362 "cpus": {"type": "string"}, 363 "memory": {"type": "string"} 364 }, 365 "additionalProperties": false 366 }, 367 "reservations": { 368 "type": "object", 369 "properties": { 370 "cpus": {"type": "string"}, 371 "memory": {"type": "string"}, 372 "generic_resources": {"$ref": "#/definitions/generic_resources"} 373 }, 374 "additionalProperties": false 375 } 376 }, 377 "additionalProperties": false 378 }, 379 "restart_policy": { 380 "type": "object", 381 "properties": { 382 "condition": {"type": "string"}, 383 "delay": {"type": "string", "format": "duration"}, 384 "max_attempts": {"type": "integer"}, 385 "window": {"type": "string", "format": "duration"} 386 }, 387 "additionalProperties": false 388 }, 389 "placement": { 390 "type": "object", 391 "properties": { 392 "constraints": {"type": "array", "items": {"type": "string"}}, 393 "preferences": { 394 "type": "array", 395 "items": { 396 "type": "object", 397 "properties": { 398 "spread": {"type": "string"} 399 }, 400 "additionalProperties": false 401 } 402 } 403 }, 404 "additionalProperties": false 405 } 406 }, 407 "additionalProperties": false 408 }, 409 410 "generic_resources": { 411 "id": "#/definitions/generic_resources", 412 "type": "array", 413 "items": { 414 "type": "object", 415 "properties": { 416 "discrete_resource_spec": { 417 "type": "object", 418 "properties": { 419 "kind": {"type": "string"}, 420 "value": {"type": "number"} 421 }, 422 "additionalProperties": false 423 } 424 }, 425 "additionalProperties": false 426 } 427 }, 428 429 "network": { 430 "id": "#/definitions/network", 431 "type": ["object", "null"], 432 "properties": { 433 "name": {"type": "string"}, 434 "driver": {"type": "string"}, 435 "driver_opts": { 436 "type": "object", 437 "patternProperties": { 438 "^.+$": {"type": ["string", "number"]} 439 } 440 }, 441 "ipam": { 442 "type": "object", 443 "properties": { 444 "driver": {"type": "string"}, 445 "config": { 446 "type": "array", 447 "items": { 448 "type": "object", 449 "properties": { 450 "subnet": {"type": "string"} 451 }, 452 "additionalProperties": false 453 } 454 } 455 }, 456 "additionalProperties": false 457 }, 458 "external": { 459 "type": ["boolean", "object"], 460 "properties": { 461 "name": {"type": "string"} 462 }, 463 "additionalProperties": false 464 }, 465 "internal": {"type": "boolean"}, 466 "attachable": {"type": "boolean"}, 467 "labels": {"$ref": "#/definitions/list_or_dict"} 468 }, 469 "additionalProperties": false 470 }, 471 472 "volume": { 473 "id": "#/definitions/volume", 474 "type": ["object", "null"], 475 "properties": { 476 "name": {"type": "string"}, 477 "driver": {"type": "string"}, 478 "driver_opts": { 479 "type": "object", 480 "patternProperties": { 481 "^.+$": {"type": ["string", "number"]} 482 } 483 }, 484 "external": { 485 "type": ["boolean", "object"], 486 "properties": { 487 "name": {"type": "string"} 488 }, 489 "additionalProperties": false 490 }, 491 "labels": {"$ref": "#/definitions/list_or_dict"} 492 }, 493 "additionalProperties": false 494 }, 495 496 "secret": { 497 "id": "#/definitions/secret", 498 "type": "object", 499 "properties": { 500 "name": {"type": "string"}, 501 "file": {"type": "string"}, 502 "external": { 503 "type": ["boolean", "object"], 504 "properties": { 505 "name": {"type": "string"} 506 } 507 }, 508 "labels": {"$ref": "#/definitions/list_or_dict"} 509 }, 510 "additionalProperties": false 511 }, 512 513 "config": { 514 "id": "#/definitions/config", 515 "type": "object", 516 "properties": { 517 "name": {"type": "string"}, 518 "file": {"type": "string"}, 519 "external": { 520 "type": ["boolean", "object"], 521 "properties": { 522 "name": {"type": "string"} 523 } 524 }, 525 "labels": {"$ref": "#/definitions/list_or_dict"} 526 }, 527 "additionalProperties": false 528 }, 529 530 "string_or_list": { 531 "oneOf": [ 532 {"type": "string"}, 533 {"$ref": "#/definitions/list_of_strings"} 534 ] 535 }, 536 537 "list_of_strings": { 538 "type": "array", 539 "items": {"type": "string"}, 540 "uniqueItems": true 541 }, 542 543 "list_or_dict": { 544 "oneOf": [ 545 { 546 "type": "object", 547 "patternProperties": { 548 ".+": { 549 "type": ["string", "number", "null"] 550 } 551 }, 552 "additionalProperties": false 553 }, 554 {"type": "array", "items": {"type": "string"}, "uniqueItems": true} 555 ] 556 }, 557 558 "constraints": { 559 "service": { 560 "id": "#/definitions/constraints/service", 561 "anyOf": [ 562 {"required": ["build"]}, 563 {"required": ["image"]} 564 ], 565 "properties": { 566 "build": { 567 "required": ["context"] 568 } 569 } 570 } 571 } 572 } 573 }