fields_schema.json 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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. "command": {
  17. "oneOf": [
  18. {"type": "string"},
  19. {"type": "array", "items": {"type": "string"}}
  20. ]
  21. },
  22. "container_name": {"type": "string"},
  23. "cpu_shares": {
  24. "oneOf": [
  25. {"type": "number"},
  26. {"type": "string"}
  27. ]
  28. },
  29. "cpuset": {"type": "string"},
  30. "detach": {"type": "boolean"},
  31. "devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  32. "dns": {"$ref": "#/definitions/string_or_list"},
  33. "dns_search": {"$ref": "#/definitions/string_or_list"},
  34. "dockerfile": {"type": "string"},
  35. "domainname": {"type": "string"},
  36. "entrypoint": {"$ref": "#/definitions/string_or_list"},
  37. "env_file": {"$ref": "#/definitions/string_or_list"},
  38. "environment": {
  39. "oneOf": [
  40. {"type": "object"},
  41. {"type": "array", "items": {"type": "string"}, "uniqueItems": true}
  42. ]
  43. },
  44. "expose": {
  45. "type": "array",
  46. "items": {"type": ["string", "number"]},
  47. "uniqueItems": true
  48. },
  49. "extends": {
  50. "type": "object",
  51. "properties": {
  52. "service": {"type": "string"},
  53. "file": {"type": "string"}
  54. },
  55. "required": ["service"],
  56. "additionalProperties": false
  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. "labels": {"$ref": "#/definitions/list_or_dict"},
  63. "links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  64. "log_driver": {"type": "string"},
  65. "log_opt": {"type": "object"},
  66. "mac_address": {"type": "string"},
  67. "mem_limit": {
  68. "oneOf": [
  69. {"type": "number"},
  70. {"type": "string"}
  71. ]
  72. },
  73. "memswap_limit": {
  74. "oneOf": [
  75. {"type": "number"},
  76. {"type": "string"}
  77. ]
  78. },
  79. "name": {"type": "string"},
  80. "net": {"type": "string"},
  81. "pid": {"type": ["string", "null"]},
  82. "ports": {
  83. "type": "array",
  84. "items": {
  85. "oneOf": [
  86. {
  87. "type": "string",
  88. "format": "ports"
  89. },
  90. {
  91. "type": "number",
  92. "format": "ports"
  93. }
  94. ]
  95. },
  96. "uniqueItems": true
  97. },
  98. "privileged": {"type": "boolean"},
  99. "read_only": {"type": "boolean"},
  100. "restart": {"type": "string"},
  101. "security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  102. "stdin_open": {"type": "string"},
  103. "tty": {"type": "string"},
  104. "user": {"type": "string"},
  105. "volumes": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  106. "volume_driver": {"type": "string"},
  107. "volumes_from": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  108. "working_dir": {"type": "string"}
  109. },
  110. "dependencies": {
  111. "memswap_limit": ["mem_limit"]
  112. },
  113. "additionalProperties": false
  114. },
  115. "string_or_list": {
  116. "oneOf": [
  117. {"type": "string"},
  118. {"$ref": "#/definitions/list_of_strings"}
  119. ]
  120. },
  121. "list_of_strings": {
  122. "type": "array",
  123. "items": {"type": "string"},
  124. "uniqueItems": true
  125. },
  126. "list_or_dict": {
  127. "oneOf": [
  128. {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  129. {"type": "object"}
  130. ]
  131. }
  132. },
  133. "additionalProperties": false
  134. }