config_schema_v2.4.json 15 KB

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