config_schema_v2.0.json 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424
  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/labels"},
  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. "priority": {"type": "number"}
  180. },
  181. "additionalProperties": false
  182. },
  183. {"type": "null"}
  184. ]
  185. }
  186. },
  187. "additionalProperties": false
  188. }
  189. ]
  190. },
  191. "oom_score_adj": {"type": "integer", "minimum": -1000, "maximum": 1000},
  192. "group_add": {
  193. "type": "array",
  194. "items": {
  195. "type": ["string", "number"]
  196. },
  197. "uniqueItems": true
  198. },
  199. "pid": {"type": ["string", "null"]},
  200. "ports": {
  201. "type": "array",
  202. "items": {
  203. "type": ["string", "number"],
  204. "format": "ports"
  205. },
  206. "uniqueItems": true
  207. },
  208. "privileged": {"type": "boolean"},
  209. "read_only": {"type": "boolean"},
  210. "restart": {"type": "string"},
  211. "security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  212. "shm_size": {"type": ["number", "string"]},
  213. "stdin_open": {"type": "boolean"},
  214. "stop_grace_period": {"type": "string", "format": "duration"},
  215. "stop_signal": {"type": "string"},
  216. "tmpfs": {"$ref": "#/definitions/string_or_list"},
  217. "tty": {"type": "boolean"},
  218. "ulimits": {
  219. "type": "object",
  220. "patternProperties": {
  221. "^[a-z]+$": {
  222. "oneOf": [
  223. {"type": "integer"},
  224. {
  225. "type":"object",
  226. "properties": {
  227. "hard": {"type": "integer"},
  228. "soft": {"type": "integer"}
  229. },
  230. "required": ["soft", "hard"],
  231. "additionalProperties": false
  232. }
  233. ]
  234. }
  235. }
  236. },
  237. "user": {"type": "string"},
  238. "volumes": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  239. "volume_driver": {"type": "string"},
  240. "volumes_from": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  241. "working_dir": {"type": "string"}
  242. },
  243. "dependencies": {
  244. "memswap_limit": ["mem_limit"]
  245. },
  246. "additionalProperties": false
  247. },
  248. "network": {
  249. "id": "#/definitions/network",
  250. "type": "object",
  251. "properties": {
  252. "driver": {"type": "string"},
  253. "driver_opts": {
  254. "type": "object",
  255. "patternProperties": {
  256. "^.+$": {"type": ["string", "number"]}
  257. }
  258. },
  259. "ipam": {
  260. "type": "object",
  261. "properties": {
  262. "driver": {"type": "string"},
  263. "config": {
  264. "type": "array",
  265. "items": {"$ref": "#/definitions/ipam_config"}
  266. },
  267. "options": {
  268. "type": "object",
  269. "patternProperties": {
  270. "^.+$": {"type": "string"}
  271. },
  272. "additionalProperties": false
  273. }
  274. },
  275. "additionalProperties": false
  276. },
  277. "external": {
  278. "type": ["boolean", "object"],
  279. "properties": {
  280. "name": {"type": "string"}
  281. },
  282. "additionalProperties": false
  283. },
  284. "internal": {"type": "boolean"}
  285. },
  286. "additionalProperties": false
  287. },
  288. "ipam_config": {
  289. "id": "#/definitions/ipam_config",
  290. "type": "object",
  291. "properties": {
  292. "subnet": {"type": "string"},
  293. "ip_range": {"type": "string"},
  294. "gateway": {"type": "string"},
  295. "aux_addresses": {
  296. "type": "object",
  297. "patternProperties": {
  298. "^.+$": {"type": "string"}
  299. },
  300. "additionalProperties": false
  301. }
  302. },
  303. "additionalProperties": false
  304. },
  305. "volume": {
  306. "id": "#/definitions/volume",
  307. "type": ["object", "null"],
  308. "properties": {
  309. "driver": {"type": "string"},
  310. "driver_opts": {
  311. "type": "object",
  312. "patternProperties": {
  313. "^.+$": {"type": ["string", "number"]}
  314. }
  315. },
  316. "external": {
  317. "type": ["boolean", "object"],
  318. "properties": {
  319. "name": {"type": "string"}
  320. },
  321. "additionalProperties": false
  322. }
  323. },
  324. "additionalProperties": false
  325. },
  326. "string_or_list": {
  327. "oneOf": [
  328. {"type": "string"},
  329. {"$ref": "#/definitions/list_of_strings"}
  330. ]
  331. },
  332. "list_of_strings": {
  333. "type": "array",
  334. "items": {"type": "string"},
  335. "uniqueItems": true
  336. },
  337. "list_or_dict": {
  338. "oneOf": [
  339. {
  340. "type": "object",
  341. "patternProperties": {
  342. ".+": {
  343. "type": ["string", "number", "null"]
  344. }
  345. },
  346. "additionalProperties": false
  347. },
  348. {"type": "array", "items": {"type": "string"}, "uniqueItems": true}
  349. ]
  350. },
  351. "labels": {
  352. "oneOf": [
  353. {
  354. "type": "object",
  355. "patternProperties": {
  356. ".+": {
  357. "type": "string"
  358. }
  359. },
  360. "additionalProperties": false
  361. },
  362. {"type": "array", "items": {"type": "string"}, "uniqueItems": true}
  363. ]
  364. },
  365. "blkio_limit": {
  366. "type": "object",
  367. "properties": {
  368. "path": {"type": "string"},
  369. "rate": {"type": ["integer", "string"]}
  370. },
  371. "additionalProperties": false
  372. },
  373. "blkio_weight": {
  374. "type": "object",
  375. "properties": {
  376. "path": {"type": "string"},
  377. "weight": {"type": "integer"}
  378. },
  379. "additionalProperties": false
  380. },
  381. "constraints": {
  382. "service": {
  383. "id": "#/definitions/constraints/service",
  384. "anyOf": [
  385. {"required": ["build"]},
  386. {"required": ["image"]}
  387. ],
  388. "properties": {
  389. "build": {
  390. "required": ["context"]
  391. }
  392. }
  393. }
  394. }
  395. }
  396. }