fields_schema.json 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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"],
  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. "name": {"type": "string"},
  82. "net": {"type": "string"},
  83. "pid": {"type": ["string", "null"]},
  84. "ports": {
  85. "type": "array",
  86. "items": {
  87. "oneOf": [
  88. {
  89. "type": "string",
  90. "format": "ports"
  91. },
  92. {
  93. "type": "number",
  94. "format": "ports"
  95. }
  96. ]
  97. },
  98. "uniqueItems": true
  99. },
  100. "privileged": {"type": "boolean"},
  101. "read_only": {"type": "boolean"},
  102. "restart": {"type": "string"},
  103. "security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  104. "stdin_open": {"type": "boolean"},
  105. "tty": {"type": "boolean"},
  106. "user": {"type": "string"},
  107. "volumes": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  108. "volume_driver": {"type": "string"},
  109. "volumes_from": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  110. "working_dir": {"type": "string"}
  111. },
  112. "dependencies": {
  113. "memswap_limit": ["mem_limit"]
  114. },
  115. "additionalProperties": false
  116. },
  117. "string_or_list": {
  118. "oneOf": [
  119. {"type": "string"},
  120. {"$ref": "#/definitions/list_of_strings"}
  121. ]
  122. },
  123. "list_of_strings": {
  124. "type": "array",
  125. "items": {"type": "string"},
  126. "uniqueItems": true
  127. },
  128. "list_or_dict": {
  129. "oneOf": [
  130. {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  131. {"type": "object"}
  132. ]
  133. }
  134. },
  135. "additionalProperties": false
  136. }