fields_schema.json 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. {
  2. "$schema": "http://json-schema.org/draft-04/schema#",
  3. "type": "object",
  4. "id": "fields_schema.json",
  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. "cpuset": {"type": "string"},
  29. "devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  30. "dns": {"$ref": "#/definitions/string_or_list"},
  31. "dns_search": {"$ref": "#/definitions/string_or_list"},
  32. "dockerfile": {"type": "string"},
  33. "domainname": {"type": "string"},
  34. "entrypoint": {"$ref": "#/definitions/string_or_list"},
  35. "env_file": {"$ref": "#/definitions/string_or_list"},
  36. "environment": {
  37. "oneOf": [
  38. {
  39. "type": "object",
  40. "patternProperties": {
  41. ".+": {
  42. "type": ["string", "number", "boolean", "null"],
  43. "format": "environment"
  44. }
  45. },
  46. "additionalProperties": false
  47. },
  48. {"type": "array", "items": {"type": "string"}, "uniqueItems": true}
  49. ]
  50. },
  51. "expose": {
  52. "type": "array",
  53. "items": {"type": ["string", "number"]},
  54. "uniqueItems": true
  55. },
  56. "extends": {
  57. "oneOf": [
  58. {
  59. "type": "string"
  60. },
  61. {
  62. "type": "object",
  63. "properties": {
  64. "service": {"type": "string"},
  65. "file": {"type": "string"}
  66. },
  67. "required": ["service"],
  68. "additionalProperties": false
  69. }
  70. ]
  71. },
  72. "extra_hosts": {"$ref": "#/definitions/list_or_dict"},
  73. "external_links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  74. "hostname": {"type": "string"},
  75. "image": {"type": "string"},
  76. "ipc": {"type": "string"},
  77. "labels": {"$ref": "#/definitions/list_or_dict"},
  78. "links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  79. "log_driver": {"type": "string"},
  80. "log_opt": {"type": "object"},
  81. "mac_address": {"type": "string"},
  82. "mem_limit": {"type": ["number", "string"]},
  83. "memswap_limit": {"type": ["number", "string"]},
  84. "net": {"type": "string"},
  85. "pid": {"type": ["string", "null"]},
  86. "ports": {
  87. "type": "array",
  88. "items": {
  89. "oneOf": [
  90. {
  91. "type": "string",
  92. "format": "ports"
  93. },
  94. {
  95. "type": "number",
  96. "format": "ports"
  97. }
  98. ]
  99. },
  100. "uniqueItems": true
  101. },
  102. "privileged": {"type": "boolean"},
  103. "read_only": {"type": "boolean"},
  104. "restart": {"type": "string"},
  105. "security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  106. "stdin_open": {"type": "boolean"},
  107. "tty": {"type": "boolean"},
  108. "ulimits": {
  109. "type": "object",
  110. "patternProperties": {
  111. "^[a-z]+$": {
  112. "oneOf": [
  113. {"type": "integer"},
  114. {
  115. "type":"object",
  116. "properties": {
  117. "hard": {"type": "integer"},
  118. "soft": {"type": "integer"}
  119. },
  120. "required": ["soft", "hard"],
  121. "additionalProperties": false
  122. }
  123. ]
  124. }
  125. }
  126. },
  127. "user": {"type": "string"},
  128. "volumes": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  129. "volume_driver": {"type": "string"},
  130. "volumes_from": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  131. "working_dir": {"type": "string"}
  132. },
  133. "dependencies": {
  134. "memswap_limit": ["mem_limit"]
  135. },
  136. "additionalProperties": false
  137. },
  138. "string_or_list": {
  139. "oneOf": [
  140. {"type": "string"},
  141. {"$ref": "#/definitions/list_of_strings"}
  142. ]
  143. },
  144. "list_of_strings": {
  145. "type": "array",
  146. "items": {"type": "string"},
  147. "uniqueItems": true
  148. },
  149. "list_or_dict": {
  150. "oneOf": [
  151. {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  152. {"type": "object"}
  153. ]
  154. }
  155. }
  156. }