config_schema_v2.3.json 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533
  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/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. "healthcheck": {"$ref": "#/definitions/healthcheck"},
  182. "hostname": {"type": "string"},
  183. "image": {"type": "string"},
  184. "init": {"type": ["boolean", "string"]},
  185. "ipc": {"type": "string"},
  186. "isolation": {"type": "string"},
  187. "labels": {"$ref": "#/definitions/labels"},
  188. "links": {"$ref": "#/definitions/list_of_strings"},
  189. "logging": {
  190. "type": "object",
  191. "properties": {
  192. "driver": {"type": "string"},
  193. "options": {"type": "object"}
  194. },
  195. "additionalProperties": false
  196. },
  197. "mac_address": {"type": "string"},
  198. "mem_limit": {"type": ["number", "string"]},
  199. "mem_reservation": {"type": ["string", "integer"]},
  200. "mem_swappiness": {"type": "integer"},
  201. "memswap_limit": {"type": ["number", "string"]},
  202. "network_mode": {"type": "string"},
  203. "networks": {
  204. "oneOf": [
  205. {"$ref": "#/definitions/list_of_strings"},
  206. {
  207. "type": "object",
  208. "patternProperties": {
  209. "^[a-zA-Z0-9._-]+$": {
  210. "oneOf": [
  211. {
  212. "type": "object",
  213. "properties": {
  214. "aliases": {"$ref": "#/definitions/list_of_strings"},
  215. "ipv4_address": {"type": "string"},
  216. "ipv6_address": {"type": "string"},
  217. "link_local_ips": {"$ref": "#/definitions/list_of_strings"},
  218. "priority": {"type": "number"}
  219. },
  220. "additionalProperties": false
  221. },
  222. {"type": "null"}
  223. ]
  224. }
  225. },
  226. "additionalProperties": false
  227. }
  228. ]
  229. },
  230. "oom_kill_disable": {"type": "boolean"},
  231. "oom_score_adj": {"type": "integer", "minimum": -1000, "maximum": 1000},
  232. "group_add": {
  233. "type": "array",
  234. "items": {
  235. "type": ["string", "number"]
  236. },
  237. "uniqueItems": true
  238. },
  239. "pid": {"type": ["string", "null"]},
  240. "ports": {
  241. "type": "array",
  242. "items": {
  243. "type": ["string", "number"],
  244. "format": "ports"
  245. },
  246. "uniqueItems": true
  247. },
  248. "privileged": {"type": "boolean"},
  249. "read_only": {"type": "boolean"},
  250. "restart": {"type": "string"},
  251. "runtime": {"type": "string"},
  252. "scale": {"type": "integer"},
  253. "security_opt": {"$ref": "#/definitions/list_of_strings"},
  254. "shm_size": {"type": ["number", "string"]},
  255. "sysctls": {"$ref": "#/definitions/list_or_dict"},
  256. "pids_limit": {"type": ["number", "string"]},
  257. "stdin_open": {"type": "boolean"},
  258. "stop_grace_period": {"type": "string", "format": "duration"},
  259. "stop_signal": {"type": "string"},
  260. "storage_opt": {"type": "object"},
  261. "tmpfs": {"$ref": "#/definitions/string_or_list"},
  262. "tty": {"type": "boolean"},
  263. "ulimits": {
  264. "type": "object",
  265. "patternProperties": {
  266. "^[a-z]+$": {
  267. "oneOf": [
  268. {"type": "integer"},
  269. {
  270. "type":"object",
  271. "properties": {
  272. "hard": {"type": "integer"},
  273. "soft": {"type": "integer"}
  274. },
  275. "required": ["soft", "hard"],
  276. "additionalProperties": false
  277. }
  278. ]
  279. }
  280. }
  281. },
  282. "user": {"type": "string"},
  283. "userns_mode": {"type": "string"},
  284. "volumes": {
  285. "type": "array",
  286. "items": {
  287. "oneOf": [
  288. {"type": "string"},
  289. {
  290. "type": "object",
  291. "required": ["type"],
  292. "additionalProperties": false,
  293. "properties": {
  294. "type": {"type": "string"},
  295. "source": {"type": "string"},
  296. "target": {"type": "string"},
  297. "read_only": {"type": "boolean"},
  298. "consistency": {"type": "string"},
  299. "bind": {
  300. "type": "object",
  301. "properties": {
  302. "propagation": {"type": "string"}
  303. }
  304. },
  305. "volume": {
  306. "type": "object",
  307. "properties": {
  308. "nocopy": {"type": "boolean"}
  309. }
  310. },
  311. "tmpfs": {
  312. "type": "object",
  313. "properties": {
  314. "size": {"type": ["integer", "string"]}
  315. }
  316. }
  317. }
  318. }
  319. ],
  320. "uniqueItems": true
  321. }
  322. },
  323. "volume_driver": {"type": "string"},
  324. "volumes_from": {"$ref": "#/definitions/list_of_strings"},
  325. "working_dir": {"type": "string"}
  326. },
  327. "dependencies": {
  328. "memswap_limit": ["mem_limit"]
  329. },
  330. "additionalProperties": false
  331. },
  332. "healthcheck": {
  333. "id": "#/definitions/healthcheck",
  334. "type": "object",
  335. "additionalProperties": false,
  336. "properties": {
  337. "disable": {"type": "boolean"},
  338. "interval": {"type": "string"},
  339. "retries": {"type": "number"},
  340. "start_period": {"type": "string"},
  341. "test": {
  342. "oneOf": [
  343. {"type": "string"},
  344. {"type": "array", "items": {"type": "string"}}
  345. ]
  346. },
  347. "timeout": {"type": "string"}
  348. }
  349. },
  350. "network": {
  351. "id": "#/definitions/network",
  352. "type": "object",
  353. "properties": {
  354. "driver": {"type": "string"},
  355. "driver_opts": {
  356. "type": "object",
  357. "patternProperties": {
  358. "^.+$": {"type": ["string", "number"]}
  359. }
  360. },
  361. "ipam": {
  362. "type": "object",
  363. "properties": {
  364. "driver": {"type": "string"},
  365. "config": {
  366. "type": "array",
  367. "items": {"$ref": "#/definitions/ipam_config"}
  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. "ipam_config": {
  394. "id": "#/definitions/ipam_config",
  395. "type": "object",
  396. "properties": {
  397. "subnet": {"type": "string"},
  398. "iprange": {"type": "string"},
  399. "gateway": {"type": "string"},
  400. "aux_addresses": {
  401. "type": "object",
  402. "patternProperties": {
  403. "^.+$": {"type": "string"}
  404. },
  405. "additionalProperties": false
  406. }
  407. },
  408. "additionalProperties": false
  409. },
  410. "volume": {
  411. "id": "#/definitions/volume",
  412. "type": ["object", "null"],
  413. "properties": {
  414. "driver": {"type": "string"},
  415. "driver_opts": {
  416. "type": "object",
  417. "patternProperties": {
  418. "^.+$": {"type": ["string", "number"]}
  419. }
  420. },
  421. "external": {
  422. "type": ["boolean", "object"],
  423. "properties": {
  424. "name": {"type": "string"}
  425. },
  426. "additionalProperties": false
  427. },
  428. "labels": {"$ref": "#/definitions/labels"},
  429. "name": {"type": "string"}
  430. },
  431. "additionalProperties": false
  432. },
  433. "string_or_list": {
  434. "oneOf": [
  435. {"type": "string"},
  436. {"$ref": "#/definitions/list_of_strings"}
  437. ]
  438. },
  439. "list_of_strings": {
  440. "type": "array",
  441. "items": {"type": "string"},
  442. "uniqueItems": true
  443. },
  444. "list_or_dict": {
  445. "oneOf": [
  446. {
  447. "type": "object",
  448. "patternProperties": {
  449. ".+": {
  450. "type": ["string", "number", "null"]
  451. }
  452. },
  453. "additionalProperties": false
  454. },
  455. {"type": "array", "items": {"type": "string"}, "uniqueItems": true}
  456. ]
  457. },
  458. "labels": {
  459. "oneOf": [
  460. {
  461. "type": "object",
  462. "patternProperties": {
  463. ".+": {
  464. "type": "string"
  465. }
  466. },
  467. "additionalProperties": false
  468. },
  469. {"type": "array", "items": {"type": "string"}, "uniqueItems": true}
  470. ]
  471. },
  472. "blkio_limit": {
  473. "type": "object",
  474. "properties": {
  475. "path": {"type": "string"},
  476. "rate": {"type": ["integer", "string"]}
  477. },
  478. "additionalProperties": false
  479. },
  480. "blkio_weight": {
  481. "type": "object",
  482. "properties": {
  483. "path": {"type": "string"},
  484. "weight": {"type": "integer"}
  485. },
  486. "additionalProperties": false
  487. },
  488. "constraints": {
  489. "service": {
  490. "id": "#/definitions/constraints/service",
  491. "anyOf": [
  492. {"required": ["build"]},
  493. {"required": ["image"]}
  494. ],
  495. "properties": {
  496. "build": {
  497. "required": ["context"]
  498. }
  499. }
  500. }
  501. }
  502. }
  503. }