fields_schema.json 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. {
  2. "$schema": "http://json-schema.org/draft-04/schema#",
  3. "type": "object",
  4. "id": "fields_schema.json",
  5. "patternProperties": {
  6. "^[a-zA-Z0-9._-]+$": {
  7. "$ref": "#/definitions/service"
  8. }
  9. },
  10. "additionalProperties": false,
  11. "definitions": {
  12. "service": {
  13. "id": "#/definitions/service",
  14. "type": "object",
  15. "properties": {
  16. "build": {"type": "string"},
  17. "cap_add": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  18. "cap_drop": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  19. "cgroup_parent": {"type": "string"},
  20. "command": {
  21. "oneOf": [
  22. {"type": "string"},
  23. {"type": "array", "items": {"type": "string"}}
  24. ]
  25. },
  26. "container_name": {"type": "string"},
  27. "cpu_shares": {"type": ["number", "string"]},
  28. "cpuset": {"type": "string"},
  29. "devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  30. "dns": {"$ref": "#/definitions/string_or_list"},
  31. "dns_search": {"$ref": "#/definitions/string_or_list"},
  32. "dockerfile": {"type": "string"},
  33. "domainname": {"type": "string"},
  34. "entrypoint": {"$ref": "#/definitions/string_or_list"},
  35. "env_file": {"$ref": "#/definitions/string_or_list"},
  36. "environment": {"$ref": "#/definitions/list_or_dict"},
  37. "expose": {
  38. "type": "array",
  39. "items": {
  40. "type": ["string", "number"],
  41. "format": "expose"
  42. },
  43. "uniqueItems": true
  44. },
  45. "extends": {
  46. "oneOf": [
  47. {
  48. "type": "string"
  49. },
  50. {
  51. "type": "object",
  52. "properties": {
  53. "service": {"type": "string"},
  54. "file": {"type": "string"}
  55. },
  56. "required": ["service"],
  57. "additionalProperties": false
  58. }
  59. ]
  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. "net": {"type": "string"},
  74. "pid": {"type": ["string", "null"]},
  75. "ports": {
  76. "type": "array",
  77. "items": {
  78. "type": ["string", "number"],
  79. "format": "ports"
  80. },
  81. "uniqueItems": true
  82. },
  83. "privileged": {"type": "boolean"},
  84. "read_only": {"type": "boolean"},
  85. "restart": {"type": "string"},
  86. "security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  87. "stdin_open": {"type": "boolean"},
  88. "tty": {"type": "boolean"},
  89. "ulimits": {
  90. "type": "object",
  91. "patternProperties": {
  92. "^[a-z]+$": {
  93. "oneOf": [
  94. {"type": "integer"},
  95. {
  96. "type":"object",
  97. "properties": {
  98. "hard": {"type": "integer"},
  99. "soft": {"type": "integer"}
  100. },
  101. "required": ["soft", "hard"],
  102. "additionalProperties": false
  103. }
  104. ]
  105. }
  106. }
  107. },
  108. "user": {"type": "string"},
  109. "volumes": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  110. "volume_driver": {"type": "string"},
  111. "volumes_from": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  112. "working_dir": {"type": "string"}
  113. },
  114. "dependencies": {
  115. "memswap_limit": ["mem_limit"]
  116. },
  117. "additionalProperties": false
  118. },
  119. "string_or_list": {
  120. "oneOf": [
  121. {"type": "string"},
  122. {"$ref": "#/definitions/list_of_strings"}
  123. ]
  124. },
  125. "list_of_strings": {
  126. "type": "array",
  127. "items": {"type": "string"},
  128. "uniqueItems": true
  129. },
  130. "list_or_dict": {
  131. "oneOf": [
  132. {
  133. "type": "object",
  134. "patternProperties": {
  135. ".+": {
  136. "type": ["string", "number", "boolean", "null"],
  137. "format": "bool-value-in-mapping"
  138. }
  139. },
  140. "additionalProperties": false
  141. },
  142. {"type": "array", "items": {"type": "string"}, "uniqueItems": true}
  143. ]
  144. }
  145. }
  146. }