github.com/AliyunContainerService/cli@v0.0.0-20181009023821-814ced4b30d0/cli/compose/schema/data/config_schema_v3.6.json (about) 1 { 2 "$schema": "http://json-schema.org/draft-04/schema#", 3 "id": "config_schema_v3.6.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 "tmpfs": { 305 "type": "object", 306 "properties": { 307 "size": { 308 "type": "integer", 309 "minimum": 0 310 } 311 } 312 } 313 }, 314 "additionalProperties": false 315 } 316 ], 317 "uniqueItems": true 318 } 319 }, 320 "working_dir": {"type": "string"} 321 }, 322 "additionalProperties": false 323 }, 324 325 "healthcheck": { 326 "id": "#/definitions/healthcheck", 327 "type": "object", 328 "additionalProperties": false, 329 "properties": { 330 "disable": {"type": "boolean"}, 331 "interval": {"type": "string", "format": "duration"}, 332 "retries": {"type": "number"}, 333 "test": { 334 "oneOf": [ 335 {"type": "string"}, 336 {"type": "array", "items": {"type": "string"}} 337 ] 338 }, 339 "timeout": {"type": "string", "format": "duration"}, 340 "start_period": {"type": "string", "format": "duration"} 341 } 342 }, 343 "deployment": { 344 "id": "#/definitions/deployment", 345 "type": ["object", "null"], 346 "properties": { 347 "mode": {"type": "string"}, 348 "endpoint_mode": {"type": "string"}, 349 "replicas": {"type": "integer"}, 350 "labels": {"$ref": "#/definitions/list_or_dict"}, 351 "update_config": { 352 "type": "object", 353 "properties": { 354 "parallelism": {"type": "integer"}, 355 "delay": {"type": "string", "format": "duration"}, 356 "failure_action": {"type": "string"}, 357 "monitor": {"type": "string", "format": "duration"}, 358 "max_failure_ratio": {"type": "number"}, 359 "order": {"type": "string", "enum": [ 360 "start-first", "stop-first" 361 ]} 362 }, 363 "additionalProperties": false 364 }, 365 "resources": { 366 "type": "object", 367 "properties": { 368 "limits": { 369 "type": "object", 370 "properties": { 371 "cpus": {"type": "string"}, 372 "memory": {"type": "string"} 373 }, 374 "additionalProperties": false 375 }, 376 "reservations": { 377 "type": "object", 378 "properties": { 379 "cpus": {"type": "string"}, 380 "memory": {"type": "string"}, 381 "generic_resources": {"$ref": "#/definitions/generic_resources"} 382 }, 383 "additionalProperties": false 384 } 385 }, 386 "additionalProperties": false 387 }, 388 "restart_policy": { 389 "type": "object", 390 "properties": { 391 "condition": {"type": "string"}, 392 "delay": {"type": "string", "format": "duration"}, 393 "max_attempts": {"type": "integer"}, 394 "window": {"type": "string", "format": "duration"} 395 }, 396 "additionalProperties": false 397 }, 398 "placement": { 399 "type": "object", 400 "properties": { 401 "constraints": {"type": "array", "items": {"type": "string"}}, 402 "preferences": { 403 "type": "array", 404 "items": { 405 "type": "object", 406 "properties": { 407 "spread": {"type": "string"} 408 }, 409 "additionalProperties": false 410 } 411 } 412 }, 413 "additionalProperties": false 414 } 415 }, 416 "additionalProperties": false 417 }, 418 419 "generic_resources": { 420 "id": "#/definitions/generic_resources", 421 "type": "array", 422 "items": { 423 "type": "object", 424 "properties": { 425 "discrete_resource_spec": { 426 "type": "object", 427 "properties": { 428 "kind": {"type": "string"}, 429 "value": {"type": "number"} 430 }, 431 "additionalProperties": false 432 } 433 }, 434 "additionalProperties": false 435 } 436 }, 437 438 "network": { 439 "id": "#/definitions/network", 440 "type": ["object", "null"], 441 "properties": { 442 "name": {"type": "string"}, 443 "driver": {"type": "string"}, 444 "driver_opts": { 445 "type": "object", 446 "patternProperties": { 447 "^.+$": {"type": ["string", "number"]} 448 } 449 }, 450 "ipam": { 451 "type": "object", 452 "properties": { 453 "driver": {"type": "string"}, 454 "config": { 455 "type": "array", 456 "items": { 457 "type": "object", 458 "properties": { 459 "subnet": {"type": "string"} 460 }, 461 "additionalProperties": false 462 } 463 } 464 }, 465 "additionalProperties": false 466 }, 467 "external": { 468 "type": ["boolean", "object"], 469 "properties": { 470 "name": {"type": "string"} 471 }, 472 "additionalProperties": false 473 }, 474 "internal": {"type": "boolean"}, 475 "attachable": {"type": "boolean"}, 476 "labels": {"$ref": "#/definitions/list_or_dict"} 477 }, 478 "additionalProperties": false 479 }, 480 481 "volume": { 482 "id": "#/definitions/volume", 483 "type": ["object", "null"], 484 "properties": { 485 "name": {"type": "string"}, 486 "driver": {"type": "string"}, 487 "driver_opts": { 488 "type": "object", 489 "patternProperties": { 490 "^.+$": {"type": ["string", "number"]} 491 } 492 }, 493 "external": { 494 "type": ["boolean", "object"], 495 "properties": { 496 "name": {"type": "string"} 497 }, 498 "additionalProperties": false 499 }, 500 "labels": {"$ref": "#/definitions/list_or_dict"} 501 }, 502 "additionalProperties": false 503 }, 504 505 "secret": { 506 "id": "#/definitions/secret", 507 "type": "object", 508 "properties": { 509 "name": {"type": "string"}, 510 "file": {"type": "string"}, 511 "external": { 512 "type": ["boolean", "object"], 513 "properties": { 514 "name": {"type": "string"} 515 } 516 }, 517 "labels": {"$ref": "#/definitions/list_or_dict"} 518 }, 519 "additionalProperties": false 520 }, 521 522 "config": { 523 "id": "#/definitions/config", 524 "type": "object", 525 "properties": { 526 "name": {"type": "string"}, 527 "file": {"type": "string"}, 528 "external": { 529 "type": ["boolean", "object"], 530 "properties": { 531 "name": {"type": "string"} 532 } 533 }, 534 "labels": {"$ref": "#/definitions/list_or_dict"} 535 }, 536 "additionalProperties": false 537 }, 538 539 "string_or_list": { 540 "oneOf": [ 541 {"type": "string"}, 542 {"$ref": "#/definitions/list_of_strings"} 543 ] 544 }, 545 546 "list_of_strings": { 547 "type": "array", 548 "items": {"type": "string"}, 549 "uniqueItems": true 550 }, 551 552 "list_or_dict": { 553 "oneOf": [ 554 { 555 "type": "object", 556 "patternProperties": { 557 ".+": { 558 "type": ["string", "number", "null"] 559 } 560 }, 561 "additionalProperties": false 562 }, 563 {"type": "array", "items": {"type": "string"}, "uniqueItems": true} 564 ] 565 }, 566 567 "constraints": { 568 "service": { 569 "id": "#/definitions/constraints/service", 570 "anyOf": [ 571 {"required": ["build"]}, 572 {"required": ["image"]} 573 ], 574 "properties": { 575 "build": { 576 "required": ["context"] 577 } 578 } 579 } 580 } 581 } 582 }