config_schema_v2.3.json 13 KB

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