compose_spec.json 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812
  1. {
  2. "$schema": "http://json-schema.org/draft/2019-09/schema#",
  3. "id": "compose_spec.json",
  4. "type": "object",
  5. "title": "Compose Specification",
  6. "description": "The Compose file is a YAML file defining a multi-containers based application.",
  7. "properties": {
  8. "version": {
  9. "type": "string",
  10. "description": "Version of the Compose specification used. Tools not implementing required version MUST reject the configuration file."
  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. "networks": {
  23. "id": "#/properties/networks",
  24. "type": "object",
  25. "patternProperties": {
  26. "^[a-zA-Z0-9._-]+$": {
  27. "$ref": "#/definitions/network"
  28. }
  29. }
  30. },
  31. "volumes": {
  32. "id": "#/properties/volumes",
  33. "type": "object",
  34. "patternProperties": {
  35. "^[a-zA-Z0-9._-]+$": {
  36. "$ref": "#/definitions/volume"
  37. }
  38. },
  39. "additionalProperties": false
  40. },
  41. "secrets": {
  42. "id": "#/properties/secrets",
  43. "type": "object",
  44. "patternProperties": {
  45. "^[a-zA-Z0-9._-]+$": {
  46. "$ref": "#/definitions/secret"
  47. }
  48. },
  49. "additionalProperties": false
  50. },
  51. "configs": {
  52. "id": "#/properties/configs",
  53. "type": "object",
  54. "patternProperties": {
  55. "^[a-zA-Z0-9._-]+$": {
  56. "$ref": "#/definitions/config"
  57. }
  58. },
  59. "additionalProperties": false
  60. }
  61. },
  62. "patternProperties": {"^x-": {}},
  63. "additionalProperties": false,
  64. "definitions": {
  65. "service": {
  66. "id": "#/definitions/service",
  67. "type": "object",
  68. "properties": {
  69. "deploy": {"$ref": "#/definitions/deployment"},
  70. "build": {
  71. "oneOf": [
  72. {"type": "string"},
  73. {
  74. "type": "object",
  75. "properties": {
  76. "context": {"type": "string"},
  77. "dockerfile": {"type": "string"},
  78. "args": {"$ref": "#/definitions/list_or_dict"},
  79. "labels": {"$ref": "#/definitions/list_or_dict"},
  80. "cache_from": {"type": "array", "items": {"type": "string"}},
  81. "network": {"type": "string"},
  82. "target": {"type": "string"},
  83. "shm_size": {"type": ["integer", "string"]},
  84. "extra_hosts": {"$ref": "#/definitions/list_or_dict"},
  85. "isolation": {"type": "string"}
  86. },
  87. "additionalProperties": false,
  88. "patternProperties": {"^x-": {}}
  89. }
  90. ]
  91. },
  92. "blkio_config": {
  93. "type": "object",
  94. "properties": {
  95. "device_read_bps": {
  96. "type": "array",
  97. "items": {"$ref": "#/definitions/blkio_limit"}
  98. },
  99. "device_read_iops": {
  100. "type": "array",
  101. "items": {"$ref": "#/definitions/blkio_limit"}
  102. },
  103. "device_write_bps": {
  104. "type": "array",
  105. "items": {"$ref": "#/definitions/blkio_limit"}
  106. },
  107. "device_write_iops": {
  108. "type": "array",
  109. "items": {"$ref": "#/definitions/blkio_limit"}
  110. },
  111. "weight": {"type": "integer"},
  112. "weight_device": {
  113. "type": "array",
  114. "items": {"$ref": "#/definitions/blkio_weight"}
  115. }
  116. },
  117. "additionalProperties": false
  118. },
  119. "cap_add": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  120. "cap_drop": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  121. "cgroup_parent": {"type": "string"},
  122. "command": {
  123. "oneOf": [
  124. {"type": "string"},
  125. {"type": "array", "items": {"type": "string"}}
  126. ]
  127. },
  128. "configs": {
  129. "type": "array",
  130. "items": {
  131. "oneOf": [
  132. {"type": "string"},
  133. {
  134. "type": "object",
  135. "properties": {
  136. "source": {"type": "string"},
  137. "target": {"type": "string"},
  138. "uid": {"type": "string"},
  139. "gid": {"type": "string"},
  140. "mode": {"type": "number"}
  141. },
  142. "additionalProperties": false,
  143. "patternProperties": {"^x-": {}}
  144. }
  145. ]
  146. }
  147. },
  148. "container_name": {"type": "string"},
  149. "cpu_count": {"type": "integer", "minimum": 0},
  150. "cpu_percent": {"type": "integer", "minimum": 0, "maximum": 100},
  151. "cpu_shares": {"type": ["number", "string"]},
  152. "cpu_quota": {"type": ["number", "string"]},
  153. "cpu_period": {"type": ["number", "string"]},
  154. "cpu_rt_period": {"type": ["number", "string"]},
  155. "cpu_rt_runtime": {"type": ["number", "string"]},
  156. "cpus": {"type": ["number", "string"]},
  157. "cpuset": {"type": "string"},
  158. "credential_spec": {
  159. "type": "object",
  160. "properties": {
  161. "config": {"type": "string"},
  162. "file": {"type": "string"},
  163. "registry": {"type": "string"}
  164. },
  165. "additionalProperties": false,
  166. "patternProperties": {"^x-": {}}
  167. },
  168. "depends_on": {
  169. "oneOf": [
  170. {"$ref": "#/definitions/list_of_strings"},
  171. {
  172. "type": "object",
  173. "additionalProperties": false,
  174. "patternProperties": {
  175. "^[a-zA-Z0-9._-]+$": {
  176. "type": "object",
  177. "additionalProperties": false,
  178. "properties": {
  179. "condition": {
  180. "type": "string",
  181. "enum": ["service_started", "service_healthy", "service_completed_successfully"]
  182. }
  183. },
  184. "required": ["condition"]
  185. }
  186. }
  187. }
  188. ]
  189. },
  190. "device_cgroup_rules": {"$ref": "#/definitions/list_of_strings"},
  191. "devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  192. "dns": {"$ref": "#/definitions/string_or_list"},
  193. "dns_opt": {"type": "array","items": {"type": "string"}, "uniqueItems": true},
  194. "dns_search": {"$ref": "#/definitions/string_or_list"},
  195. "domainname": {"type": "string"},
  196. "entrypoint": {
  197. "oneOf": [
  198. {"type": "string"},
  199. {"type": "array", "items": {"type": "string"}}
  200. ]
  201. },
  202. "env_file": {"$ref": "#/definitions/string_or_list"},
  203. "environment": {"$ref": "#/definitions/list_or_dict"},
  204. "expose": {
  205. "type": "array",
  206. "items": {
  207. "type": ["string", "number"],
  208. "format": "expose"
  209. },
  210. "uniqueItems": true
  211. },
  212. "extends": {
  213. "oneOf": [
  214. {"type": "string"},
  215. {
  216. "type": "object",
  217. "properties": {
  218. "service": {"type": "string"},
  219. "file": {"type": "string"}
  220. },
  221. "required": ["service"],
  222. "additionalProperties": false
  223. }
  224. ]
  225. },
  226. "external_links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  227. "extra_hosts": {"$ref": "#/definitions/list_or_dict"},
  228. "group_add": {
  229. "type": "array",
  230. "items": {
  231. "type": ["string", "number"]
  232. },
  233. "uniqueItems": true
  234. },
  235. "healthcheck": {"$ref": "#/definitions/healthcheck"},
  236. "hostname": {"type": "string"},
  237. "image": {"type": "string"},
  238. "init": {"type": "boolean"},
  239. "ipc": {"type": "string"},
  240. "isolation": {"type": "string"},
  241. "labels": {"$ref": "#/definitions/list_or_dict"},
  242. "links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  243. "logging": {
  244. "type": "object",
  245. "properties": {
  246. "driver": {"type": "string"},
  247. "options": {
  248. "type": "object",
  249. "patternProperties": {
  250. "^.+$": {"type": ["string", "number", "null"]}
  251. }
  252. }
  253. },
  254. "additionalProperties": false,
  255. "patternProperties": {"^x-": {}}
  256. },
  257. "mac_address": {"type": "string"},
  258. "mem_limit": {"type": ["number", "string"]},
  259. "mem_reservation": {"type": ["string", "integer"]},
  260. "mem_swappiness": {"type": "integer"},
  261. "memswap_limit": {"type": ["number", "string"]},
  262. "network_mode": {"type": "string"},
  263. "networks": {
  264. "oneOf": [
  265. {"$ref": "#/definitions/list_of_strings"},
  266. {
  267. "type": "object",
  268. "patternProperties": {
  269. "^[a-zA-Z0-9._-]+$": {
  270. "oneOf": [
  271. {
  272. "type": "object",
  273. "properties": {
  274. "aliases": {"$ref": "#/definitions/list_of_strings"},
  275. "ipv4_address": {"type": "string"},
  276. "ipv6_address": {"type": "string"},
  277. "link_local_ips": {"$ref": "#/definitions/list_of_strings"},
  278. "priority": {"type": "number"}
  279. },
  280. "additionalProperties": false,
  281. "patternProperties": {"^x-": {}}
  282. },
  283. {"type": "null"}
  284. ]
  285. }
  286. },
  287. "additionalProperties": false
  288. }
  289. ]
  290. },
  291. "oom_kill_disable": {"type": "boolean"},
  292. "oom_score_adj": {"type": "integer", "minimum": -1000, "maximum": 1000},
  293. "pid": {"type": ["string", "null"]},
  294. "pids_limit": {"type": ["number", "string"]},
  295. "platform": {"type": "string"},
  296. "ports": {
  297. "type": "array",
  298. "items": {
  299. "oneOf": [
  300. {"type": "number", "format": "ports"},
  301. {"type": "string", "format": "ports"},
  302. {
  303. "type": "object",
  304. "properties": {
  305. "mode": {"type": "string"},
  306. "target": {"type": "integer"},
  307. "published": {"type": "integer"},
  308. "protocol": {"type": "string"}
  309. },
  310. "additionalProperties": false,
  311. "patternProperties": {"^x-": {}}
  312. }
  313. ]
  314. },
  315. "uniqueItems": true
  316. },
  317. "privileged": {"type": "boolean"},
  318. "profiles": {"$ref": "#/definitions/list_of_strings"},
  319. "pull_policy": {"type": "string", "enum": [
  320. "always", "never", "if_not_present", "build"
  321. ]},
  322. "read_only": {"type": "boolean"},
  323. "restart": {"type": "string"},
  324. "runtime": {
  325. "type": "string"
  326. },
  327. "scale": {
  328. "type": "integer"
  329. },
  330. "security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  331. "shm_size": {"type": ["number", "string"]},
  332. "secrets": {
  333. "type": "array",
  334. "items": {
  335. "oneOf": [
  336. {"type": "string"},
  337. {
  338. "type": "object",
  339. "properties": {
  340. "source": {"type": "string"},
  341. "target": {"type": "string"},
  342. "uid": {"type": "string"},
  343. "gid": {"type": "string"},
  344. "mode": {"type": "number"}
  345. },
  346. "additionalProperties": false,
  347. "patternProperties": {"^x-": {}}
  348. }
  349. ]
  350. }
  351. },
  352. "sysctls": {"$ref": "#/definitions/list_or_dict"},
  353. "stdin_open": {"type": "boolean"},
  354. "stop_grace_period": {"type": "string", "format": "duration"},
  355. "stop_signal": {"type": "string"},
  356. "storage_opt": {"type": "object"},
  357. "tmpfs": {"$ref": "#/definitions/string_or_list"},
  358. "tty": {"type": "boolean"},
  359. "ulimits": {
  360. "type": "object",
  361. "patternProperties": {
  362. "^[a-z]+$": {
  363. "oneOf": [
  364. {"type": "integer"},
  365. {
  366. "type": "object",
  367. "properties": {
  368. "hard": {"type": "integer"},
  369. "soft": {"type": "integer"}
  370. },
  371. "required": ["soft", "hard"],
  372. "additionalProperties": false,
  373. "patternProperties": {"^x-": {}}
  374. }
  375. ]
  376. }
  377. }
  378. },
  379. "user": {"type": "string"},
  380. "userns_mode": {"type": "string"},
  381. "volumes": {
  382. "type": "array",
  383. "items": {
  384. "oneOf": [
  385. {"type": "string"},
  386. {
  387. "type": "object",
  388. "required": ["type"],
  389. "properties": {
  390. "type": {"type": "string"},
  391. "source": {"type": "string"},
  392. "target": {"type": "string"},
  393. "read_only": {"type": "boolean"},
  394. "consistency": {"type": "string"},
  395. "bind": {
  396. "type": "object",
  397. "properties": {
  398. "propagation": {"type": "string"}
  399. },
  400. "additionalProperties": false,
  401. "patternProperties": {"^x-": {}}
  402. },
  403. "volume": {
  404. "type": "object",
  405. "properties": {
  406. "nocopy": {"type": "boolean"}
  407. },
  408. "additionalProperties": false,
  409. "patternProperties": {"^x-": {}}
  410. },
  411. "tmpfs": {
  412. "type": "object",
  413. "properties": {
  414. "size": {
  415. "type": "integer",
  416. "minimum": 0
  417. }
  418. },
  419. "additionalProperties": false,
  420. "patternProperties": {"^x-": {}}
  421. }
  422. },
  423. "additionalProperties": false,
  424. "patternProperties": {"^x-": {}}
  425. }
  426. ]
  427. },
  428. "uniqueItems": true
  429. },
  430. "volumes_from": {
  431. "type": "array",
  432. "items": {"type": "string"},
  433. "uniqueItems": true
  434. },
  435. "working_dir": {"type": "string"}
  436. },
  437. "patternProperties": {"^x-": {}},
  438. "additionalProperties": false
  439. },
  440. "healthcheck": {
  441. "id": "#/definitions/healthcheck",
  442. "type": "object",
  443. "properties": {
  444. "disable": {"type": "boolean"},
  445. "interval": {"type": "string", "format": "duration"},
  446. "retries": {"type": "number"},
  447. "test": {
  448. "oneOf": [
  449. {"type": "string"},
  450. {"type": "array", "items": {"type": "string"}}
  451. ]
  452. },
  453. "timeout": {"type": "string", "format": "duration"},
  454. "start_period": {"type": "string", "format": "duration"}
  455. },
  456. "additionalProperties": false,
  457. "patternProperties": {"^x-": {}}
  458. },
  459. "deployment": {
  460. "id": "#/definitions/deployment",
  461. "type": ["object", "null"],
  462. "properties": {
  463. "mode": {"type": "string"},
  464. "endpoint_mode": {"type": "string"},
  465. "replicas": {"type": "integer"},
  466. "labels": {"$ref": "#/definitions/list_or_dict"},
  467. "rollback_config": {
  468. "type": "object",
  469. "properties": {
  470. "parallelism": {"type": "integer"},
  471. "delay": {"type": "string", "format": "duration"},
  472. "failure_action": {"type": "string"},
  473. "monitor": {"type": "string", "format": "duration"},
  474. "max_failure_ratio": {"type": "number"},
  475. "order": {"type": "string", "enum": [
  476. "start-first", "stop-first"
  477. ]}
  478. },
  479. "additionalProperties": false,
  480. "patternProperties": {"^x-": {}}
  481. },
  482. "update_config": {
  483. "type": "object",
  484. "properties": {
  485. "parallelism": {"type": "integer"},
  486. "delay": {"type": "string", "format": "duration"},
  487. "failure_action": {"type": "string"},
  488. "monitor": {"type": "string", "format": "duration"},
  489. "max_failure_ratio": {"type": "number"},
  490. "order": {"type": "string", "enum": [
  491. "start-first", "stop-first"
  492. ]}
  493. },
  494. "additionalProperties": false,
  495. "patternProperties": {"^x-": {}}
  496. },
  497. "resources": {
  498. "type": "object",
  499. "properties": {
  500. "limits": {
  501. "type": "object",
  502. "properties": {
  503. "cpus": {"type": ["number", "string"]},
  504. "memory": {"type": "string"}
  505. },
  506. "additionalProperties": false,
  507. "patternProperties": {"^x-": {}}
  508. },
  509. "reservations": {
  510. "type": "object",
  511. "properties": {
  512. "cpus": {"type": ["number", "string"]},
  513. "memory": {"type": "string"},
  514. "generic_resources": {"$ref": "#/definitions/generic_resources"},
  515. "devices": {"$ref": "#/definitions/devices"}
  516. },
  517. "additionalProperties": false,
  518. "patternProperties": {"^x-": {}}
  519. }
  520. },
  521. "additionalProperties": false,
  522. "patternProperties": {"^x-": {}}
  523. },
  524. "restart_policy": {
  525. "type": "object",
  526. "properties": {
  527. "condition": {"type": "string"},
  528. "delay": {"type": "string", "format": "duration"},
  529. "max_attempts": {"type": "integer"},
  530. "window": {"type": "string", "format": "duration"}
  531. },
  532. "additionalProperties": false,
  533. "patternProperties": {"^x-": {}}
  534. },
  535. "placement": {
  536. "type": "object",
  537. "properties": {
  538. "constraints": {"type": "array", "items": {"type": "string"}},
  539. "preferences": {
  540. "type": "array",
  541. "items": {
  542. "type": "object",
  543. "properties": {
  544. "spread": {"type": "string"}
  545. },
  546. "additionalProperties": false,
  547. "patternProperties": {"^x-": {}}
  548. }
  549. },
  550. "max_replicas_per_node": {"type": "integer"}
  551. },
  552. "additionalProperties": false,
  553. "patternProperties": {"^x-": {}}
  554. }
  555. },
  556. "additionalProperties": false,
  557. "patternProperties": {"^x-": {}}
  558. },
  559. "generic_resources": {
  560. "id": "#/definitions/generic_resources",
  561. "type": "array",
  562. "items": {
  563. "type": "object",
  564. "properties": {
  565. "discrete_resource_spec": {
  566. "type": "object",
  567. "properties": {
  568. "kind": {"type": "string"},
  569. "value": {"type": "number"}
  570. },
  571. "additionalProperties": false,
  572. "patternProperties": {"^x-": {}}
  573. }
  574. },
  575. "additionalProperties": false,
  576. "patternProperties": {"^x-": {}}
  577. }
  578. },
  579. "devices": {
  580. "id": "#/definitions/devices",
  581. "type": "array",
  582. "items": {
  583. "type": "object",
  584. "properties": {
  585. "capabilities": {"$ref": "#/definitions/list_of_strings"},
  586. "count": {"type": ["string", "integer"]},
  587. "device_ids": {"$ref": "#/definitions/list_of_strings"},
  588. "driver":{"type": "string"},
  589. "options":{"$ref": "#/definitions/list_or_dict"}
  590. },
  591. "additionalProperties": false,
  592. "patternProperties": {"^x-": {}}
  593. }
  594. },
  595. "network": {
  596. "id": "#/definitions/network",
  597. "type": ["object", "null"],
  598. "properties": {
  599. "name": {"type": "string"},
  600. "driver": {"type": "string"},
  601. "driver_opts": {
  602. "type": "object",
  603. "patternProperties": {
  604. "^.+$": {"type": ["string", "number"]}
  605. }
  606. },
  607. "ipam": {
  608. "type": "object",
  609. "properties": {
  610. "driver": {"type": "string"},
  611. "config": {
  612. "type": "array",
  613. "items": {
  614. "type": "object",
  615. "properties": {
  616. "subnet": {"type": "string", "format": "subnet_ip_address"},
  617. "ip_range": {"type": "string"},
  618. "gateway": {"type": "string"},
  619. "aux_addresses": {
  620. "type": "object",
  621. "additionalProperties": false,
  622. "patternProperties": {"^.+$": {"type": "string"}}
  623. }
  624. },
  625. "additionalProperties": false,
  626. "patternProperties": {"^x-": {}}
  627. }
  628. },
  629. "options": {
  630. "type": "object",
  631. "additionalProperties": false,
  632. "patternProperties": {"^.+$": {"type": "string"}}
  633. }
  634. },
  635. "additionalProperties": false,
  636. "patternProperties": {"^x-": {}}
  637. },
  638. "external": {
  639. "type": ["boolean", "object"],
  640. "properties": {
  641. "name": {
  642. "deprecated": true,
  643. "type": "string"
  644. }
  645. },
  646. "additionalProperties": false,
  647. "patternProperties": {"^x-": {}}
  648. },
  649. "internal": {"type": "boolean"},
  650. "enable_ipv6": {"type": "boolean"},
  651. "attachable": {"type": "boolean"},
  652. "labels": {"$ref": "#/definitions/list_or_dict"}
  653. },
  654. "additionalProperties": false,
  655. "patternProperties": {"^x-": {}}
  656. },
  657. "volume": {
  658. "id": "#/definitions/volume",
  659. "type": ["object", "null"],
  660. "properties": {
  661. "name": {"type": "string"},
  662. "driver": {"type": "string"},
  663. "driver_opts": {
  664. "type": "object",
  665. "patternProperties": {
  666. "^.+$": {"type": ["string", "number"]}
  667. }
  668. },
  669. "external": {
  670. "type": ["boolean", "object"],
  671. "properties": {
  672. "name": {
  673. "deprecated": true,
  674. "type": "string"
  675. }
  676. },
  677. "additionalProperties": false,
  678. "patternProperties": {"^x-": {}}
  679. },
  680. "labels": {"$ref": "#/definitions/list_or_dict"}
  681. },
  682. "additionalProperties": false,
  683. "patternProperties": {"^x-": {}}
  684. },
  685. "secret": {
  686. "id": "#/definitions/secret",
  687. "type": "object",
  688. "properties": {
  689. "name": {"type": "string"},
  690. "file": {"type": "string"},
  691. "external": {
  692. "type": ["boolean", "object"],
  693. "properties": {
  694. "name": {"type": "string"}
  695. }
  696. },
  697. "labels": {"$ref": "#/definitions/list_or_dict"},
  698. "driver": {"type": "string"},
  699. "driver_opts": {
  700. "type": "object",
  701. "patternProperties": {
  702. "^.+$": {"type": ["string", "number"]}
  703. }
  704. },
  705. "template_driver": {"type": "string"}
  706. },
  707. "additionalProperties": false,
  708. "patternProperties": {"^x-": {}}
  709. },
  710. "config": {
  711. "id": "#/definitions/config",
  712. "type": "object",
  713. "properties": {
  714. "name": {"type": "string"},
  715. "file": {"type": "string"},
  716. "external": {
  717. "type": ["boolean", "object"],
  718. "properties": {
  719. "name": {
  720. "deprecated": true,
  721. "type": "string"
  722. }
  723. }
  724. },
  725. "labels": {"$ref": "#/definitions/list_or_dict"},
  726. "template_driver": {"type": "string"}
  727. },
  728. "additionalProperties": false,
  729. "patternProperties": {"^x-": {}}
  730. },
  731. "string_or_list": {
  732. "oneOf": [
  733. {"type": "string"},
  734. {"$ref": "#/definitions/list_of_strings"}
  735. ]
  736. },
  737. "list_of_strings": {
  738. "type": "array",
  739. "items": {"type": "string"},
  740. "uniqueItems": true
  741. },
  742. "list_or_dict": {
  743. "oneOf": [
  744. {
  745. "type": "object",
  746. "patternProperties": {
  747. ".+": {
  748. "type": ["string", "number", "null"]
  749. }
  750. },
  751. "additionalProperties": false
  752. },
  753. {"type": "array", "items": {"type": "string"}, "uniqueItems": true}
  754. ]
  755. },
  756. "blkio_limit": {
  757. "type": "object",
  758. "properties": {
  759. "path": {"type": "string"},
  760. "rate": {"type": ["integer", "string"]}
  761. },
  762. "additionalProperties": false
  763. },
  764. "blkio_weight": {
  765. "type": "object",
  766. "properties": {
  767. "path": {"type": "string"},
  768. "weight": {"type": "integer"}
  769. },
  770. "additionalProperties": false
  771. },
  772. "constraints": {
  773. "service": {
  774. "id": "#/definitions/constraints/service",
  775. "anyOf": [
  776. {"required": ["build"]},
  777. {"required": ["image"]}
  778. ],
  779. "properties": {
  780. "build": {
  781. "required": ["context"]
  782. }
  783. }
  784. }
  785. }
  786. }
  787. }