config_schema_v3.8.json 24 KB

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