fields_schema.json 4.2 KB

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