config_schema_v1.json 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. {
  2. "$schema": "http://json-schema.org/draft-04/schema#",
  3. "id": "config_schema_v1.json",
  4. "type": "object",
  5. "patternProperties": {
  6. "^[a-zA-Z0-9._-]+$": {
  7. "$ref": "#/definitions/service"
  8. }
  9. },
  10. "additionalProperties": false,
  11. "definitions": {
  12. "service": {
  13. "id": "#/definitions/service",
  14. "type": "object",
  15. "properties": {
  16. "build": {"type": "string"},
  17. "cap_add": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  18. "cap_drop": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  19. "cgroup_parent": {"type": "string"},
  20. "command": {
  21. "oneOf": [
  22. {"type": "string"},
  23. {"type": "array", "items": {"type": "string"}}
  24. ]
  25. },
  26. "container_name": {"type": "string"},
  27. "cpu_shares": {"type": ["number", "string"]},
  28. "cpu_quota": {"type": ["number", "string"]},
  29. "cpuset": {"type": "string"},
  30. "devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  31. "dns": {"$ref": "#/definitions/string_or_list"},
  32. "dns_search": {"$ref": "#/definitions/string_or_list"},
  33. "dockerfile": {"type": "string"},
  34. "domainname": {"type": "string"},
  35. "entrypoint": {
  36. "oneOf": [
  37. {"type": "string"},
  38. {"type": "array", "items": {"type": "string"}}
  39. ]
  40. },
  41. "env_file": {"$ref": "#/definitions/string_or_list"},
  42. "environment": {"$ref": "#/definitions/list_or_dict"},
  43. "expose": {
  44. "type": "array",
  45. "items": {
  46. "type": ["string", "number"],
  47. "format": "expose"
  48. },
  49. "uniqueItems": true
  50. },
  51. "extends": {
  52. "oneOf": [
  53. {
  54. "type": "string"
  55. },
  56. {
  57. "type": "object",
  58. "properties": {
  59. "service": {"type": "string"},
  60. "file": {"type": "string"}
  61. },
  62. "required": ["service"],
  63. "additionalProperties": false
  64. }
  65. ]
  66. },
  67. "extra_hosts": {"$ref": "#/definitions/list_or_dict"},
  68. "external_links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  69. "hostname": {"type": "string"},
  70. "image": {"type": "string"},
  71. "ipc": {"type": "string"},
  72. "labels": {"$ref": "#/definitions/list_or_dict"},
  73. "links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  74. "log_driver": {"type": "string"},
  75. "log_opt": {"type": "object"},
  76. "mac_address": {"type": "string"},
  77. "mem_limit": {"type": ["number", "string"]},
  78. "memswap_limit": {"type": ["number", "string"]},
  79. "net": {"type": "string"},
  80. "pid": {"type": ["string", "null"]},
  81. "ports": {
  82. "type": "array",
  83. "items": {
  84. "type": ["string", "number"],
  85. "format": "ports"
  86. },
  87. "uniqueItems": true
  88. },
  89. "privileged": {"type": "boolean"},
  90. "read_only": {"type": "boolean"},
  91. "restart": {"type": "string"},
  92. "security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  93. "shm_size": {"type": ["number", "string"]},
  94. "stdin_open": {"type": "boolean"},
  95. "stop_signal": {"type": "string"},
  96. "tty": {"type": "boolean"},
  97. "ulimits": {
  98. "type": "object",
  99. "patternProperties": {
  100. "^[a-z]+$": {
  101. "oneOf": [
  102. {"type": "integer"},
  103. {
  104. "type":"object",
  105. "properties": {
  106. "hard": {"type": "integer"},
  107. "soft": {"type": "integer"}
  108. },
  109. "required": ["soft", "hard"],
  110. "additionalProperties": false
  111. }
  112. ]
  113. }
  114. }
  115. },
  116. "user": {"type": "string"},
  117. "volumes": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  118. "volume_driver": {"type": "string"},
  119. "volumes_from": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  120. "working_dir": {"type": "string"}
  121. },
  122. "dependencies": {
  123. "memswap_limit": ["mem_limit"]
  124. },
  125. "additionalProperties": false
  126. },
  127. "string_or_list": {
  128. "oneOf": [
  129. {"type": "string"},
  130. {"$ref": "#/definitions/list_of_strings"}
  131. ]
  132. },
  133. "list_of_strings": {
  134. "type": "array",
  135. "items": {"type": "string"},
  136. "uniqueItems": true
  137. },
  138. "list_or_dict": {
  139. "oneOf": [
  140. {
  141. "type": "object",
  142. "patternProperties": {
  143. ".+": {
  144. "type": ["string", "number", "null"]
  145. }
  146. },
  147. "additionalProperties": false
  148. },
  149. {"type": "array", "items": {"type": "string"}, "uniqueItems": true}
  150. ]
  151. },
  152. "constraints": {
  153. "service": {
  154. "id": "#/definitions/constraints/service",
  155. "anyOf": [
  156. {
  157. "required": ["build"],
  158. "not": {"required": ["image"]}
  159. },
  160. {
  161. "required": ["image"],
  162. "not": {"anyOf": [
  163. {"required": ["build"]},
  164. {"required": ["dockerfile"]}
  165. ]}
  166. }
  167. ]
  168. }
  169. }
  170. }
  171. }