config_schema_v3.7.json 23 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013
  1. {
  2. "$schema": "http://json-schema.org/draft-04/schema#",
  3. "id": "config_schema_v3.7.json",
  4. "type": "object",
  5. "required": [
  6. "version"
  7. ],
  8. "properties": {
  9. "version": {
  10. "type": "string"
  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": {
  63. "^x-": {}
  64. },
  65. "additionalProperties": false,
  66. "definitions": {
  67. "service": {
  68. "id": "#/definitions/service",
  69. "type": "object",
  70. "properties": {
  71. "deploy": {
  72. "$ref": "#/definitions/deployment"
  73. },
  74. "build": {
  75. "oneOf": [
  76. {
  77. "type": "string"
  78. },
  79. {
  80. "type": "object",
  81. "properties": {
  82. "context": {
  83. "type": "string"
  84. },
  85. "dockerfile": {
  86. "type": "string"
  87. },
  88. "args": {
  89. "$ref": "#/definitions/list_or_dict"
  90. },
  91. "labels": {
  92. "$ref": "#/definitions/list_or_dict"
  93. },
  94. "cache_from": {
  95. "$ref": "#/definitions/list_of_strings"
  96. },
  97. "network": {
  98. "type": "string"
  99. },
  100. "target": {
  101. "type": "string"
  102. },
  103. "shm_size": {
  104. "type": [
  105. "integer",
  106. "string"
  107. ]
  108. }
  109. },
  110. "additionalProperties": false
  111. }
  112. ]
  113. },
  114. "cap_add": {
  115. "type": "array",
  116. "items": {
  117. "type": "string"
  118. },
  119. "uniqueItems": true
  120. },
  121. "cap_drop": {
  122. "type": "array",
  123. "items": {
  124. "type": "string"
  125. },
  126. "uniqueItems": true
  127. },
  128. "cgroup_parent": {
  129. "type": "string"
  130. },
  131. "command": {
  132. "oneOf": [
  133. {
  134. "type": "string"
  135. },
  136. {
  137. "type": "array",
  138. "items": {
  139. "type": "string"
  140. }
  141. }
  142. ]
  143. },
  144. "configs": {
  145. "type": "array",
  146. "items": {
  147. "oneOf": [
  148. {
  149. "type": "string"
  150. },
  151. {
  152. "type": "object",
  153. "properties": {
  154. "source": {
  155. "type": "string"
  156. },
  157. "target": {
  158. "type": "string"
  159. },
  160. "uid": {
  161. "type": "string"
  162. },
  163. "gid": {
  164. "type": "string"
  165. },
  166. "mode": {
  167. "type": "number"
  168. }
  169. }
  170. }
  171. ]
  172. }
  173. },
  174. "container_name": {
  175. "type": "string"
  176. },
  177. "credential_spec": {
  178. "type": "object",
  179. "properties": {
  180. "file": {
  181. "type": "string"
  182. },
  183. "registry": {
  184. "type": "string"
  185. }
  186. }
  187. },
  188. "depends_on": {
  189. "$ref": "#/definitions/list_of_strings"
  190. },
  191. "devices": {
  192. "type": "array",
  193. "items": {
  194. "type": "string"
  195. },
  196. "uniqueItems": true
  197. },
  198. "dns": {
  199. "$ref": "#/definitions/string_or_list"
  200. },
  201. "dns_search": {
  202. "$ref": "#/definitions/string_or_list"
  203. },
  204. "domainname": {
  205. "type": "string"
  206. },
  207. "entrypoint": {
  208. "oneOf": [
  209. {
  210. "type": "string"
  211. },
  212. {
  213. "type": "array",
  214. "items": {
  215. "type": "string"
  216. }
  217. }
  218. ]
  219. },
  220. "env_file": {
  221. "$ref": "#/definitions/string_or_list"
  222. },
  223. "environment": {
  224. "$ref": "#/definitions/list_or_dict"
  225. },
  226. "expose": {
  227. "type": "array",
  228. "items": {
  229. "type": [
  230. "string",
  231. "number"
  232. ],
  233. "format": "expose"
  234. },
  235. "uniqueItems": true
  236. },
  237. "external_links": {
  238. "type": "array",
  239. "items": {
  240. "type": "string"
  241. },
  242. "uniqueItems": true
  243. },
  244. "extra_hosts": {
  245. "$ref": "#/definitions/list_or_dict"
  246. },
  247. "healthcheck": {
  248. "$ref": "#/definitions/healthcheck"
  249. },
  250. "hostname": {
  251. "type": "string"
  252. },
  253. "image": {
  254. "type": "string"
  255. },
  256. "init": {
  257. "type": "boolean"
  258. },
  259. "ipc": {
  260. "type": "string"
  261. },
  262. "isolation": {
  263. "type": "string"
  264. },
  265. "labels": {
  266. "$ref": "#/definitions/list_or_dict"
  267. },
  268. "links": {
  269. "type": "array",
  270. "items": {
  271. "type": "string"
  272. },
  273. "uniqueItems": true
  274. },
  275. "logging": {
  276. "type": "object",
  277. "properties": {
  278. "driver": {
  279. "type": "string"
  280. },
  281. "options": {
  282. "type": "object",
  283. "patternProperties": {
  284. "^.+$": {
  285. "type": [
  286. "string",
  287. "number",
  288. "null"
  289. ]
  290. }
  291. }
  292. }
  293. },
  294. "additionalProperties": false
  295. },
  296. "mac_address": {
  297. "type": "string"
  298. },
  299. "network_mode": {
  300. "type": "string"
  301. },
  302. "networks": {
  303. "oneOf": [
  304. {
  305. "$ref": "#/definitions/list_of_strings"
  306. },
  307. {
  308. "type": "object",
  309. "patternProperties": {
  310. "^[a-zA-Z0-9._-]+$": {
  311. "oneOf": [
  312. {
  313. "type": "object",
  314. "properties": {
  315. "aliases": {
  316. "$ref": "#/definitions/list_of_strings"
  317. },
  318. "ipv4_address": {
  319. "type": "string"
  320. },
  321. "ipv6_address": {
  322. "type": "string"
  323. }
  324. },
  325. "additionalProperties": false
  326. },
  327. {
  328. "type": "null"
  329. }
  330. ]
  331. }
  332. },
  333. "additionalProperties": false
  334. }
  335. ]
  336. },
  337. "pid": {
  338. "type": [
  339. "string",
  340. "null"
  341. ]
  342. },
  343. "ports": {
  344. "type": "array",
  345. "items": {
  346. "oneOf": [
  347. {
  348. "type": "number",
  349. "format": "ports"
  350. },
  351. {
  352. "type": "string",
  353. "format": "ports"
  354. },
  355. {
  356. "type": "object",
  357. "properties": {
  358. "mode": {
  359. "type": "string"
  360. },
  361. "target": {
  362. "type": "integer"
  363. },
  364. "published": {
  365. "type": "integer"
  366. },
  367. "protocol": {
  368. "type": "string"
  369. }
  370. },
  371. "additionalProperties": false
  372. }
  373. ]
  374. },
  375. "uniqueItems": true
  376. },
  377. "privileged": {
  378. "type": "boolean"
  379. },
  380. "read_only": {
  381. "type": "boolean"
  382. },
  383. "restart": {
  384. "type": "string"
  385. },
  386. "security_opt": {
  387. "type": "array",
  388. "items": {
  389. "type": "string"
  390. },
  391. "uniqueItems": true
  392. },
  393. "shm_size": {
  394. "type": [
  395. "number",
  396. "string"
  397. ]
  398. },
  399. "secrets": {
  400. "type": "array",
  401. "items": {
  402. "oneOf": [
  403. {
  404. "type": "string"
  405. },
  406. {
  407. "type": "object",
  408. "properties": {
  409. "source": {
  410. "type": "string"
  411. },
  412. "target": {
  413. "type": "string"
  414. },
  415. "uid": {
  416. "type": "string"
  417. },
  418. "gid": {
  419. "type": "string"
  420. },
  421. "mode": {
  422. "type": "number"
  423. }
  424. }
  425. }
  426. ]
  427. }
  428. },
  429. "sysctls": {
  430. "$ref": "#/definitions/list_or_dict"
  431. },
  432. "stdin_open": {
  433. "type": "boolean"
  434. },
  435. "stop_grace_period": {
  436. "type": "string",
  437. "format": "duration"
  438. },
  439. "stop_signal": {
  440. "type": "string"
  441. },
  442. "tmpfs": {
  443. "$ref": "#/definitions/string_or_list"
  444. },
  445. "tty": {
  446. "type": "boolean"
  447. },
  448. "ulimits": {
  449. "type": "object",
  450. "patternProperties": {
  451. "^[a-z]+$": {
  452. "oneOf": [
  453. {
  454. "type": "integer"
  455. },
  456. {
  457. "type": "object",
  458. "properties": {
  459. "hard": {
  460. "type": "integer"
  461. },
  462. "soft": {
  463. "type": "integer"
  464. }
  465. },
  466. "required": [
  467. "soft",
  468. "hard"
  469. ],
  470. "additionalProperties": false
  471. }
  472. ]
  473. }
  474. }
  475. },
  476. "user": {
  477. "type": "string"
  478. },
  479. "userns_mode": {
  480. "type": "string"
  481. },
  482. "volumes": {
  483. "type": "array",
  484. "items": {
  485. "oneOf": [
  486. {
  487. "type": "string"
  488. },
  489. {
  490. "type": "object",
  491. "required": [
  492. "type"
  493. ],
  494. "properties": {
  495. "type": {
  496. "type": "string"
  497. },
  498. "source": {
  499. "type": "string"
  500. },
  501. "target": {
  502. "type": "string"
  503. },
  504. "read_only": {
  505. "type": "boolean"
  506. },
  507. "consistency": {
  508. "type": "string"
  509. },
  510. "bind": {
  511. "type": "object",
  512. "properties": {
  513. "propagation": {
  514. "type": "string"
  515. }
  516. }
  517. },
  518. "volume": {
  519. "type": "object",
  520. "properties": {
  521. "nocopy": {
  522. "type": "boolean"
  523. }
  524. }
  525. },
  526. "tmpfs": {
  527. "type": "object",
  528. "properties": {
  529. "size": {
  530. "type": "integer",
  531. "minimum": 0
  532. }
  533. }
  534. }
  535. },
  536. "additionalProperties": false
  537. }
  538. ],
  539. "uniqueItems": true
  540. }
  541. },
  542. "working_dir": {
  543. "type": "string"
  544. }
  545. },
  546. "patternProperties": {
  547. "^x-": {}
  548. },
  549. "additionalProperties": false
  550. },
  551. "healthcheck": {
  552. "id": "#/definitions/healthcheck",
  553. "type": "object",
  554. "additionalProperties": false,
  555. "properties": {
  556. "disable": {
  557. "type": "boolean"
  558. },
  559. "interval": {
  560. "type": "string",
  561. "format": "duration"
  562. },
  563. "retries": {
  564. "type": "number"
  565. },
  566. "test": {
  567. "oneOf": [
  568. {
  569. "type": "string"
  570. },
  571. {
  572. "type": "array",
  573. "items": {
  574. "type": "string"
  575. }
  576. }
  577. ]
  578. },
  579. "timeout": {
  580. "type": "string",
  581. "format": "duration"
  582. },
  583. "start_period": {
  584. "type": "string",
  585. "format": "duration"
  586. }
  587. }
  588. },
  589. "deployment": {
  590. "id": "#/definitions/deployment",
  591. "type": [
  592. "object",
  593. "null"
  594. ],
  595. "properties": {
  596. "mode": {
  597. "type": "string"
  598. },
  599. "endpoint_mode": {
  600. "type": "string"
  601. },
  602. "replicas": {
  603. "type": "integer"
  604. },
  605. "labels": {
  606. "$ref": "#/definitions/list_or_dict"
  607. },
  608. "rollback_config": {
  609. "type": "object",
  610. "properties": {
  611. "parallelism": {
  612. "type": "integer"
  613. },
  614. "delay": {
  615. "type": "string",
  616. "format": "duration"
  617. },
  618. "failure_action": {
  619. "type": "string"
  620. },
  621. "monitor": {
  622. "type": "string",
  623. "format": "duration"
  624. },
  625. "max_failure_ratio": {
  626. "type": "number"
  627. },
  628. "order": {
  629. "type": "string",
  630. "enum": [
  631. "start-first",
  632. "stop-first"
  633. ]
  634. }
  635. },
  636. "additionalProperties": false
  637. },
  638. "update_config": {
  639. "type": "object",
  640. "properties": {
  641. "parallelism": {
  642. "type": "integer"
  643. },
  644. "delay": {
  645. "type": "string",
  646. "format": "duration"
  647. },
  648. "failure_action": {
  649. "type": "string"
  650. },
  651. "monitor": {
  652. "type": "string",
  653. "format": "duration"
  654. },
  655. "max_failure_ratio": {
  656. "type": "number"
  657. },
  658. "order": {
  659. "type": "string",
  660. "enum": [
  661. "start-first",
  662. "stop-first"
  663. ]
  664. }
  665. },
  666. "additionalProperties": false
  667. },
  668. "resources": {
  669. "type": "object",
  670. "properties": {
  671. "limits": {
  672. "type": "object",
  673. "properties": {
  674. "cpus": {
  675. "type": "string"
  676. },
  677. "memory": {
  678. "type": "string"
  679. }
  680. },
  681. "additionalProperties": false
  682. },
  683. "reservations": {
  684. "type": "object",
  685. "properties": {
  686. "cpus": {
  687. "type": "string"
  688. },
  689. "memory": {
  690. "type": "string"
  691. },
  692. "generic_resources": {
  693. "$ref": "#/definitions/generic_resources"
  694. }
  695. },
  696. "additionalProperties": false
  697. }
  698. },
  699. "additionalProperties": false
  700. },
  701. "restart_policy": {
  702. "type": "object",
  703. "properties": {
  704. "condition": {
  705. "type": "string"
  706. },
  707. "delay": {
  708. "type": "string",
  709. "format": "duration"
  710. },
  711. "max_attempts": {
  712. "type": "integer"
  713. },
  714. "window": {
  715. "type": "string",
  716. "format": "duration"
  717. }
  718. },
  719. "additionalProperties": false
  720. },
  721. "placement": {
  722. "type": "object",
  723. "properties": {
  724. "constraints": {
  725. "type": "array",
  726. "items": {
  727. "type": "string"
  728. }
  729. },
  730. "preferences": {
  731. "type": "array",
  732. "items": {
  733. "type": "object",
  734. "properties": {
  735. "spread": {
  736. "type": "string"
  737. }
  738. },
  739. "additionalProperties": false
  740. }
  741. }
  742. },
  743. "additionalProperties": false
  744. }
  745. },
  746. "additionalProperties": false
  747. },
  748. "generic_resources": {
  749. "id": "#/definitions/generic_resources",
  750. "type": "array",
  751. "items": {
  752. "type": "object",
  753. "properties": {
  754. "discrete_resource_spec": {
  755. "type": "object",
  756. "properties": {
  757. "kind": {
  758. "type": "string"
  759. },
  760. "value": {
  761. "type": "number"
  762. }
  763. },
  764. "additionalProperties": false
  765. }
  766. },
  767. "additionalProperties": false
  768. }
  769. },
  770. "network": {
  771. "id": "#/definitions/network",
  772. "type": [
  773. "object",
  774. "null"
  775. ],
  776. "properties": {
  777. "name": {
  778. "type": "string"
  779. },
  780. "driver": {
  781. "type": "string"
  782. },
  783. "driver_opts": {
  784. "type": "object",
  785. "patternProperties": {
  786. "^.+$": {
  787. "type": [
  788. "string",
  789. "number"
  790. ]
  791. }
  792. }
  793. },
  794. "ipam": {
  795. "type": "object",
  796. "properties": {
  797. "driver": {
  798. "type": "string"
  799. },
  800. "config": {
  801. "type": "array",
  802. "items": {
  803. "type": "object",
  804. "properties": {
  805. "subnet": {
  806. "type": "string"
  807. }
  808. },
  809. "additionalProperties": false
  810. }
  811. }
  812. },
  813. "additionalProperties": false
  814. },
  815. "external": {
  816. "type": [
  817. "boolean",
  818. "object"
  819. ],
  820. "properties": {
  821. "name": {
  822. "type": "string"
  823. }
  824. },
  825. "additionalProperties": false
  826. },
  827. "internal": {
  828. "type": "boolean"
  829. },
  830. "attachable": {
  831. "type": "boolean"
  832. },
  833. "labels": {
  834. "$ref": "#/definitions/list_or_dict"
  835. }
  836. },
  837. "patternProperties": {
  838. "^x-": {}
  839. },
  840. "additionalProperties": false
  841. },
  842. "volume": {
  843. "id": "#/definitions/volume",
  844. "type": [
  845. "object",
  846. "null"
  847. ],
  848. "properties": {
  849. "name": {
  850. "type": "string"
  851. },
  852. "driver": {
  853. "type": "string"
  854. },
  855. "driver_opts": {
  856. "type": "object",
  857. "patternProperties": {
  858. "^.+$": {
  859. "type": [
  860. "string",
  861. "number"
  862. ]
  863. }
  864. }
  865. },
  866. "external": {
  867. "type": [
  868. "boolean",
  869. "object"
  870. ],
  871. "properties": {
  872. "name": {
  873. "type": "string"
  874. }
  875. },
  876. "additionalProperties": false
  877. },
  878. "labels": {
  879. "$ref": "#/definitions/list_or_dict"
  880. }
  881. },
  882. "patternProperties": {
  883. "^x-": {}
  884. },
  885. "additionalProperties": false
  886. },
  887. "secret": {
  888. "id": "#/definitions/secret",
  889. "type": "object",
  890. "properties": {
  891. "name": {
  892. "type": "string"
  893. },
  894. "file": {
  895. "type": "string"
  896. },
  897. "external": {
  898. "type": [
  899. "boolean",
  900. "object"
  901. ],
  902. "properties": {
  903. "name": {
  904. "type": "string"
  905. }
  906. }
  907. },
  908. "labels": {
  909. "$ref": "#/definitions/list_or_dict"
  910. }
  911. },
  912. "patternProperties": {
  913. "^x-": {}
  914. },
  915. "additionalProperties": false
  916. },
  917. "config": {
  918. "id": "#/definitions/config",
  919. "type": "object",
  920. "properties": {
  921. "name": {
  922. "type": "string"
  923. },
  924. "file": {
  925. "type": "string"
  926. },
  927. "external": {
  928. "type": [
  929. "boolean",
  930. "object"
  931. ],
  932. "properties": {
  933. "name": {
  934. "type": "string"
  935. }
  936. }
  937. },
  938. "labels": {
  939. "$ref": "#/definitions/list_or_dict"
  940. }
  941. },
  942. "patternProperties": {
  943. "^x-": {}
  944. },
  945. "additionalProperties": false
  946. },
  947. "string_or_list": {
  948. "oneOf": [
  949. {
  950. "type": "string"
  951. },
  952. {
  953. "$ref": "#/definitions/list_of_strings"
  954. }
  955. ]
  956. },
  957. "list_of_strings": {
  958. "type": "array",
  959. "items": {
  960. "type": "string"
  961. },
  962. "uniqueItems": true
  963. },
  964. "list_or_dict": {
  965. "oneOf": [
  966. {
  967. "type": "object",
  968. "patternProperties": {
  969. ".+": {
  970. "type": [
  971. "string",
  972. "number",
  973. "null"
  974. ]
  975. }
  976. },
  977. "additionalProperties": false
  978. },
  979. {
  980. "type": "array",
  981. "items": {
  982. "type": "string"
  983. },
  984. "uniqueItems": true
  985. }
  986. ]
  987. },
  988. "constraints": {
  989. "service": {
  990. "id": "#/definitions/constraints/service",
  991. "anyOf": [
  992. {
  993. "required": [
  994. "build"
  995. ]
  996. },
  997. {
  998. "required": [
  999. "image"
  1000. ]
  1001. }
  1002. ],
  1003. "properties": {
  1004. "build": {
  1005. "required": [
  1006. "context"
  1007. ]
  1008. }
  1009. }
  1010. }
  1011. }
  1012. }
  1013. }