config_schema_v2.2.json 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449
  1. {
  2. "$schema": "http://json-schema.org/draft-04/schema#",
  3. "id": "config_schema_v2.2.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. "labels": {"$ref": "#/definitions/list_or_dict"},
  83. "cache_from": {"$ref": "#/definitions/list_of_strings"},
  84. "network": {"type": "string"}
  85. },
  86. "additionalProperties": false
  87. }
  88. ]
  89. },
  90. "cap_add": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  91. "cap_drop": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  92. "cgroup_parent": {"type": "string"},
  93. "command": {
  94. "oneOf": [
  95. {"type": "string"},
  96. {"type": "array", "items": {"type": "string"}}
  97. ]
  98. },
  99. "container_name": {"type": "string"},
  100. "cpu_count": {"type": "integer", "minimum": 0},
  101. "cpu_percent": {"type": "integer", "minimum": 0, "maximum": 100},
  102. "cpu_shares": {"type": ["number", "string"]},
  103. "cpu_quota": {"type": ["number", "string"]},
  104. "cpus": {"type": "number", "minimum": 0},
  105. "cpuset": {"type": "string"},
  106. "depends_on": {
  107. "oneOf": [
  108. {"$ref": "#/definitions/list_of_strings"},
  109. {
  110. "type": "object",
  111. "additionalProperties": false,
  112. "patternProperties": {
  113. "^[a-zA-Z0-9._-]+$": {
  114. "type": "object",
  115. "additionalProperties": false,
  116. "properties": {
  117. "condition": {
  118. "type": "string",
  119. "enum": ["service_started", "service_healthy"]
  120. }
  121. },
  122. "required": ["condition"]
  123. }
  124. }
  125. }
  126. ]
  127. },
  128. "devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  129. "dns_opt": {
  130. "type": "array",
  131. "items": {
  132. "type": "string"
  133. },
  134. "uniqueItems": true
  135. },
  136. "dns": {"$ref": "#/definitions/string_or_list"},
  137. "dns_search": {"$ref": "#/definitions/string_or_list"},
  138. "domainname": {"type": "string"},
  139. "entrypoint": {
  140. "oneOf": [
  141. {"type": "string"},
  142. {"type": "array", "items": {"type": "string"}}
  143. ]
  144. },
  145. "env_file": {"$ref": "#/definitions/string_or_list"},
  146. "environment": {"$ref": "#/definitions/list_or_dict"},
  147. "expose": {
  148. "type": "array",
  149. "items": {
  150. "type": ["string", "number"],
  151. "format": "expose"
  152. },
  153. "uniqueItems": true
  154. },
  155. "extends": {
  156. "oneOf": [
  157. {
  158. "type": "string"
  159. },
  160. {
  161. "type": "object",
  162. "properties": {
  163. "service": {"type": "string"},
  164. "file": {"type": "string"}
  165. },
  166. "required": ["service"],
  167. "additionalProperties": false
  168. }
  169. ]
  170. },
  171. "external_links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  172. "extra_hosts": {"$ref": "#/definitions/list_or_dict"},
  173. "healthcheck": {"$ref": "#/definitions/healthcheck"},
  174. "hostname": {"type": "string"},
  175. "image": {"type": "string"},
  176. "init": {"type": ["boolean", "string"]},
  177. "ipc": {"type": "string"},
  178. "isolation": {"type": "string"},
  179. "labels": {"$ref": "#/definitions/list_or_dict"},
  180. "links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  181. "logging": {
  182. "type": "object",
  183. "properties": {
  184. "driver": {"type": "string"},
  185. "options": {"type": "object"}
  186. },
  187. "additionalProperties": false
  188. },
  189. "mac_address": {"type": "string"},
  190. "mem_limit": {"type": ["number", "string"]},
  191. "mem_reservation": {"type": ["string", "integer"]},
  192. "mem_swappiness": {"type": "integer"},
  193. "memswap_limit": {"type": ["number", "string"]},
  194. "network_mode": {"type": "string"},
  195. "networks": {
  196. "oneOf": [
  197. {"$ref": "#/definitions/list_of_strings"},
  198. {
  199. "type": "object",
  200. "patternProperties": {
  201. "^[a-zA-Z0-9._-]+$": {
  202. "oneOf": [
  203. {
  204. "type": "object",
  205. "properties": {
  206. "aliases": {"$ref": "#/definitions/list_of_strings"},
  207. "ipv4_address": {"type": "string"},
  208. "ipv6_address": {"type": "string"},
  209. "link_local_ips": {"$ref": "#/definitions/list_of_strings"}
  210. },
  211. "additionalProperties": false
  212. },
  213. {"type": "null"}
  214. ]
  215. }
  216. },
  217. "additionalProperties": false
  218. }
  219. ]
  220. },
  221. "oom_kill_disable": {"type": "boolean"},
  222. "oom_score_adj": {"type": "integer", "minimum": -1000, "maximum": 1000},
  223. "group_add": {
  224. "type": "array",
  225. "items": {
  226. "type": ["string", "number"]
  227. },
  228. "uniqueItems": true
  229. },
  230. "pid": {"type": ["string", "null"]},
  231. "ports": {
  232. "type": "array",
  233. "items": {
  234. "type": ["string", "number"],
  235. "format": "ports"
  236. },
  237. "uniqueItems": true
  238. },
  239. "privileged": {"type": "boolean"},
  240. "read_only": {"type": "boolean"},
  241. "restart": {"type": "string"},
  242. "scale": {"type": "integer"},
  243. "security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  244. "shm_size": {"type": ["number", "string"]},
  245. "sysctls": {"$ref": "#/definitions/list_or_dict"},
  246. "pids_limit": {"type": ["number", "string"]},
  247. "stdin_open": {"type": "boolean"},
  248. "stop_grace_period": {"type": "string", "format": "duration"},
  249. "stop_signal": {"type": "string"},
  250. "storage_opt": {"type": "object"},
  251. "tmpfs": {"$ref": "#/definitions/string_or_list"},
  252. "tty": {"type": "boolean"},
  253. "ulimits": {
  254. "type": "object",
  255. "patternProperties": {
  256. "^[a-z]+$": {
  257. "oneOf": [
  258. {"type": "integer"},
  259. {
  260. "type":"object",
  261. "properties": {
  262. "hard": {"type": "integer"},
  263. "soft": {"type": "integer"}
  264. },
  265. "required": ["soft", "hard"],
  266. "additionalProperties": false
  267. }
  268. ]
  269. }
  270. }
  271. },
  272. "user": {"type": "string"},
  273. "userns_mode": {"type": "string"},
  274. "volumes": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  275. "volume_driver": {"type": "string"},
  276. "volumes_from": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  277. "working_dir": {"type": "string"}
  278. },
  279. "dependencies": {
  280. "memswap_limit": ["mem_limit"]
  281. },
  282. "additionalProperties": false
  283. },
  284. "healthcheck": {
  285. "id": "#/definitions/healthcheck",
  286. "type": "object",
  287. "additionalProperties": false,
  288. "properties": {
  289. "disable": {"type": "boolean"},
  290. "interval": {"type": "string"},
  291. "retries": {"type": "number"},
  292. "test": {
  293. "oneOf": [
  294. {"type": "string"},
  295. {"type": "array", "items": {"type": "string"}}
  296. ]
  297. },
  298. "timeout": {"type": "string"}
  299. }
  300. },
  301. "network": {
  302. "id": "#/definitions/network",
  303. "type": "object",
  304. "properties": {
  305. "driver": {"type": "string"},
  306. "driver_opts": {
  307. "type": "object",
  308. "patternProperties": {
  309. "^.+$": {"type": ["string", "number"]}
  310. }
  311. },
  312. "ipam": {
  313. "type": "object",
  314. "properties": {
  315. "driver": {"type": "string"},
  316. "config": {
  317. "type": "array"
  318. },
  319. "options": {
  320. "type": "object",
  321. "patternProperties": {
  322. "^.+$": {"type": "string"}
  323. },
  324. "additionalProperties": false
  325. }
  326. },
  327. "additionalProperties": false
  328. },
  329. "external": {
  330. "type": ["boolean", "object"],
  331. "properties": {
  332. "name": {"type": "string"}
  333. },
  334. "additionalProperties": false
  335. },
  336. "internal": {"type": "boolean"},
  337. "enable_ipv6": {"type": "boolean"},
  338. "labels": {"$ref": "#/definitions/list_or_dict"}
  339. },
  340. "additionalProperties": false
  341. },
  342. "volume": {
  343. "id": "#/definitions/volume",
  344. "type": ["object", "null"],
  345. "properties": {
  346. "driver": {"type": "string"},
  347. "driver_opts": {
  348. "type": "object",
  349. "patternProperties": {
  350. "^.+$": {"type": ["string", "number"]}
  351. }
  352. },
  353. "external": {
  354. "type": ["boolean", "object"],
  355. "properties": {
  356. "name": {"type": "string"}
  357. },
  358. "additionalProperties": false
  359. },
  360. "labels": {"$ref": "#/definitions/list_or_dict"},
  361. "name": {"type": "string"}
  362. },
  363. "additionalProperties": false
  364. },
  365. "string_or_list": {
  366. "oneOf": [
  367. {"type": "string"},
  368. {"$ref": "#/definitions/list_of_strings"}
  369. ]
  370. },
  371. "list_of_strings": {
  372. "type": "array",
  373. "items": {"type": "string"},
  374. "uniqueItems": true
  375. },
  376. "list_or_dict": {
  377. "oneOf": [
  378. {
  379. "type": "object",
  380. "patternProperties": {
  381. ".+": {
  382. "type": ["string", "number", "null"]
  383. }
  384. },
  385. "additionalProperties": false
  386. },
  387. {"type": "array", "items": {"type": "string"}, "uniqueItems": true}
  388. ]
  389. },
  390. "blkio_limit": {
  391. "type": "object",
  392. "properties": {
  393. "path": {"type": "string"},
  394. "rate": {"type": ["integer", "string"]}
  395. },
  396. "additionalProperties": false
  397. },
  398. "blkio_weight": {
  399. "type": "object",
  400. "properties": {
  401. "path": {"type": "string"},
  402. "weight": {"type": "integer"}
  403. },
  404. "additionalProperties": false
  405. },
  406. "constraints": {
  407. "service": {
  408. "id": "#/definitions/constraints/service",
  409. "anyOf": [
  410. {"required": ["build"]},
  411. {"required": ["image"]}
  412. ],
  413. "properties": {
  414. "build": {
  415. "required": ["context"]
  416. }
  417. }
  418. }
  419. }
  420. }
  421. }