fields_schema.json 4.2 KB

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