fields_schema.json 4.2 KB

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