config_schema_v2.3.json 14 KB

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