config_schema_v2.0.json 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  1. {
  2. "$schema": "http://json-schema.org/draft-04/schema#",
  3. "id": "config_schema_v2.0.json",
  4. "type": "object",
  5. "properties": {
  6. "version": {
  7. "type": "string"
  8. },
  9. "services": {
  10. "id": "#/properties/services",
  11. "type": "object",
  12. "patternProperties": {
  13. "^[a-zA-Z0-9._-]+$": {
  14. "$ref": "#/definitions/service"
  15. }
  16. },
  17. "additionalProperties": false
  18. },
  19. "networks": {
  20. "id": "#/properties/networks",
  21. "type": "object",
  22. "patternProperties": {
  23. "^[a-zA-Z0-9._-]+$": {
  24. "$ref": "#/definitions/network"
  25. }
  26. }
  27. },
  28. "volumes": {
  29. "id": "#/properties/volumes",
  30. "type": "object",
  31. "patternProperties": {
  32. "^[a-zA-Z0-9._-]+$": {
  33. "$ref": "#/definitions/volume"
  34. }
  35. },
  36. "additionalProperties": false
  37. }
  38. },
  39. "patternProperties": {"^x-": {}},
  40. "additionalProperties": false,
  41. "definitions": {
  42. "service": {
  43. "id": "#/definitions/service",
  44. "type": "object",
  45. "properties": {
  46. "blkio_config": {
  47. "type": "object",
  48. "properties": {
  49. "device_read_bps": {
  50. "type": "array",
  51. "items": {"$ref": "#/definitions/blkio_limit"}
  52. },
  53. "device_read_iops": {
  54. "type": "array",
  55. "items": {"$ref": "#/definitions/blkio_limit"}
  56. },
  57. "device_write_bps": {
  58. "type": "array",
  59. "items": {"$ref": "#/definitions/blkio_limit"}
  60. },
  61. "device_write_iops": {
  62. "type": "array",
  63. "items": {"$ref": "#/definitions/blkio_limit"}
  64. },
  65. "weight": {"type": "integer"},
  66. "weight_device": {
  67. "type": "array",
  68. "items": {"$ref": "#/definitions/blkio_weight"}
  69. }
  70. },
  71. "additionalProperties": false
  72. },
  73. "build": {
  74. "oneOf": [
  75. {"type": "string"},
  76. {
  77. "type": "object",
  78. "properties": {
  79. "context": {"type": "string"},
  80. "dockerfile": {"type": "string"},
  81. "args": {"$ref": "#/definitions/list_or_dict"}
  82. },
  83. "additionalProperties": false
  84. }
  85. ]
  86. },
  87. "cap_add": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  88. "cap_drop": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  89. "cgroup_parent": {"type": "string"},
  90. "command": {
  91. "oneOf": [
  92. {"type": "string"},
  93. {"type": "array", "items": {"type": "string"}}
  94. ]
  95. },
  96. "container_name": {"type": "string"},
  97. "cpu_shares": {"type": ["number", "string"]},
  98. "cpu_quota": {"type": ["number", "string"]},
  99. "cpuset": {"type": "string"},
  100. "depends_on": {"$ref": "#/definitions/list_of_strings"},
  101. "devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  102. "dns": {"$ref": "#/definitions/string_or_list"},
  103. "dns_opt": {
  104. "type": "array",
  105. "items": {
  106. "type": "string"
  107. },
  108. "uniqueItems": true
  109. },
  110. "dns_search": {"$ref": "#/definitions/string_or_list"},
  111. "domainname": {"type": "string"},
  112. "entrypoint": {
  113. "oneOf": [
  114. {"type": "string"},
  115. {"type": "array", "items": {"type": "string"}}
  116. ]
  117. },
  118. "env_file": {"$ref": "#/definitions/string_or_list"},
  119. "environment": {"$ref": "#/definitions/list_or_dict"},
  120. "expose": {
  121. "type": "array",
  122. "items": {
  123. "type": ["string", "number"],
  124. "format": "expose"
  125. },
  126. "uniqueItems": true
  127. },
  128. "extends": {
  129. "oneOf": [
  130. {
  131. "type": "string"
  132. },
  133. {
  134. "type": "object",
  135. "properties": {
  136. "service": {"type": "string"},
  137. "file": {"type": "string"}
  138. },
  139. "required": ["service"],
  140. "additionalProperties": false
  141. }
  142. ]
  143. },
  144. "external_links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  145. "extra_hosts": {"$ref": "#/definitions/list_or_dict"},
  146. "hostname": {"type": "string"},
  147. "image": {"type": "string"},
  148. "ipc": {"type": "string"},
  149. "labels": {"$ref": "#/definitions/list_or_dict"},
  150. "links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  151. "logging": {
  152. "type": "object",
  153. "properties": {
  154. "driver": {"type": "string"},
  155. "options": {"type": "object"}
  156. },
  157. "additionalProperties": false
  158. },
  159. "mac_address": {"type": "string"},
  160. "mem_limit": {"type": ["number", "string"]},
  161. "mem_reservation": {"type": ["string", "integer"]},
  162. "mem_swappiness": {"type": "integer"},
  163. "memswap_limit": {"type": ["number", "string"]},
  164. "network_mode": {"type": "string"},
  165. "networks": {
  166. "oneOf": [
  167. {"$ref": "#/definitions/list_of_strings"},
  168. {
  169. "type": "object",
  170. "patternProperties": {
  171. "^[a-zA-Z0-9._-]+$": {
  172. "oneOf": [
  173. {
  174. "type": "object",
  175. "properties": {
  176. "aliases": {"$ref": "#/definitions/list_of_strings"},
  177. "ipv4_address": {"type": "string"},
  178. "ipv6_address": {"type": "string"}
  179. },
  180. "additionalProperties": false
  181. },
  182. {"type": "null"}
  183. ]
  184. }
  185. },
  186. "additionalProperties": false
  187. }
  188. ]
  189. },
  190. "oom_score_adj": {"type": "integer", "minimum": -1000, "maximum": 1000},
  191. "group_add": {
  192. "type": "array",
  193. "items": {
  194. "type": ["string", "number"]
  195. },
  196. "uniqueItems": true
  197. },
  198. "pid": {"type": ["string", "null"]},
  199. "ports": {
  200. "type": "array",
  201. "items": {
  202. "type": ["string", "number"],
  203. "format": "ports"
  204. },
  205. "uniqueItems": true
  206. },
  207. "privileged": {"type": "boolean"},
  208. "read_only": {"type": "boolean"},
  209. "restart": {"type": "string"},
  210. "security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  211. "shm_size": {"type": ["number", "string"]},
  212. "stdin_open": {"type": "boolean"},
  213. "stop_grace_period": {"type": "string", "format": "duration"},
  214. "stop_signal": {"type": "string"},
  215. "tmpfs": {"$ref": "#/definitions/string_or_list"},
  216. "tty": {"type": "boolean"},
  217. "ulimits": {
  218. "type": "object",
  219. "patternProperties": {
  220. "^[a-z]+$": {
  221. "oneOf": [
  222. {"type": "integer"},
  223. {
  224. "type":"object",
  225. "properties": {
  226. "hard": {"type": "integer"},
  227. "soft": {"type": "integer"}
  228. },
  229. "required": ["soft", "hard"],
  230. "additionalProperties": false
  231. }
  232. ]
  233. }
  234. }
  235. },
  236. "user": {"type": "string"},
  237. "volumes": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  238. "volume_driver": {"type": "string"},
  239. "volumes_from": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  240. "working_dir": {"type": "string"}
  241. },
  242. "dependencies": {
  243. "memswap_limit": ["mem_limit"]
  244. },
  245. "additionalProperties": false
  246. },
  247. "network": {
  248. "id": "#/definitions/network",
  249. "type": "object",
  250. "properties": {
  251. "driver": {"type": "string"},
  252. "driver_opts": {
  253. "type": "object",
  254. "patternProperties": {
  255. "^.+$": {"type": ["string", "number"]}
  256. }
  257. },
  258. "ipam": {
  259. "type": "object",
  260. "properties": {
  261. "driver": {"type": "string"},
  262. "config": {
  263. "type": "array"
  264. },
  265. "options": {
  266. "type": "object",
  267. "patternProperties": {
  268. "^.+$": {"type": "string"}
  269. },
  270. "additionalProperties": false
  271. }
  272. },
  273. "additionalProperties": false
  274. },
  275. "external": {
  276. "type": ["boolean", "object"],
  277. "properties": {
  278. "name": {"type": "string"}
  279. },
  280. "additionalProperties": false
  281. },
  282. "internal": {"type": "boolean"},
  283. "priority": {"type": "number"}
  284. },
  285. "additionalProperties": false
  286. },
  287. "volume": {
  288. "id": "#/definitions/volume",
  289. "type": ["object", "null"],
  290. "properties": {
  291. "driver": {"type": "string"},
  292. "driver_opts": {
  293. "type": "object",
  294. "patternProperties": {
  295. "^.+$": {"type": ["string", "number"]}
  296. }
  297. },
  298. "external": {
  299. "type": ["boolean", "object"],
  300. "properties": {
  301. "name": {"type": "string"}
  302. },
  303. "additionalProperties": false
  304. }
  305. },
  306. "additionalProperties": false
  307. },
  308. "string_or_list": {
  309. "oneOf": [
  310. {"type": "string"},
  311. {"$ref": "#/definitions/list_of_strings"}
  312. ]
  313. },
  314. "list_of_strings": {
  315. "type": "array",
  316. "items": {"type": "string"},
  317. "uniqueItems": true
  318. },
  319. "list_or_dict": {
  320. "oneOf": [
  321. {
  322. "type": "object",
  323. "patternProperties": {
  324. ".+": {
  325. "type": ["string", "number", "null"]
  326. }
  327. },
  328. "additionalProperties": false
  329. },
  330. {"type": "array", "items": {"type": "string"}, "uniqueItems": true}
  331. ]
  332. },
  333. "blkio_limit": {
  334. "type": "object",
  335. "properties": {
  336. "path": {"type": "string"},
  337. "rate": {"type": ["integer", "string"]}
  338. },
  339. "additionalProperties": false
  340. },
  341. "blkio_weight": {
  342. "type": "object",
  343. "properties": {
  344. "path": {"type": "string"},
  345. "weight": {"type": "integer"}
  346. },
  347. "additionalProperties": false
  348. },
  349. "constraints": {
  350. "service": {
  351. "id": "#/definitions/constraints/service",
  352. "anyOf": [
  353. {"required": ["build"]},
  354. {"required": ["image"]}
  355. ],
  356. "properties": {
  357. "build": {
  358. "required": ["context"]
  359. }
  360. }
  361. }
  362. }
  363. }
  364. }