schema.json 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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": {"type": "number"},
  60. "memswap_limit": {"type": "number"},
  61. "name": {"type": "string"},
  62. "net": {"type": "string"},
  63. "pid": {"type": "string"},
  64. "ports": {
  65. "oneOf": [
  66. {"type": "string", "format": "ports"},
  67. {
  68. "type": "array",
  69. "items": {"type": "string"},
  70. "uniqueItems": true,
  71. "format": "ports"
  72. }
  73. ]
  74. },
  75. "privileged": {"type": "string"},
  76. "read_only": {"type": "boolean"},
  77. "restart": {"type": "string"},
  78. "security_opt": {"type": "string"},
  79. "stdin_open": {"type": "string"},
  80. "tty": {"type": "string"},
  81. "user": {"type": "string"},
  82. "volumes": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  83. "volumes_from": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  84. "working_dir": {"type": "string"}
  85. },
  86. "anyOf": [
  87. {
  88. "required": ["build"],
  89. "not": {"required": ["image"]}
  90. },
  91. {
  92. "required": ["image"],
  93. "not": {"required": ["build"]}
  94. },
  95. {
  96. "required": ["extends"],
  97. "not": {"required": ["build", "image"]}
  98. }
  99. ],
  100. "dependencies": {
  101. "memswap_limit": ["mem_limit"]
  102. },
  103. "additionalProperties": false
  104. },
  105. "string_or_list": {
  106. "oneOf": [
  107. {"type": "string"},
  108. {"$ref": "#/definitions/list_of_strings"}
  109. ]
  110. },
  111. "list_of_strings": {
  112. "type": "array",
  113. "items": {"type": "string"},
  114. "uniqueItems": true
  115. },
  116. "list_or_dict": {
  117. "oneOf": [
  118. {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  119. {"type": "object"}
  120. ]
  121. }
  122. },
  123. "additionalProperties": false
  124. }