schema.json 4.3 KB

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