fields_schema.json 4.9 KB

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