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": {"$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": {"type": "object"},
  52. "mac_address": {"type": "string"},
  53. "mem_limit": {
  54. "oneOf": [
  55. {"type": "number"},
  56. {"type": "string"}
  57. ]
  58. },
  59. "memswap_limit": {
  60. "oneOf": [
  61. {"type": "number"},
  62. {"type": "string"}
  63. ]
  64. },
  65. "name": {"type": "string"},
  66. "net": {"type": "string"},
  67. "pid": {"type": "string"},
  68. "ports": {
  69. "type": "array",
  70. "items": {
  71. "oneOf": [
  72. {
  73. "type": "string",
  74. "format": "ports"
  75. },
  76. {
  77. "type": "number",
  78. "format": "ports"
  79. }
  80. ]
  81. },
  82. "uniqueItems": true
  83. },
  84. "privileged": {"type": "string"},
  85. "read_only": {"type": "boolean"},
  86. "restart": {"type": "string"},
  87. "security_opt": {"type": "string"},
  88. "stdin_open": {"type": "string"},
  89. "tty": {"type": "string"},
  90. "user": {"type": "string"},
  91. "volumes": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  92. "volumes_from": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  93. "working_dir": {"type": "string"}
  94. },
  95. "anyOf": [
  96. {
  97. "required": ["build"],
  98. "not": {"required": ["image"]}
  99. },
  100. {
  101. "required": ["image"],
  102. "not": {"required": ["build"]}
  103. },
  104. {
  105. "required": ["extends"],
  106. "not": {"required": ["build", "image"]}
  107. }
  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. }