fields_schema.json 4.9 KB

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