fields_schema_v1.json 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. {
  2. "$schema": "http://json-schema.org/draft-04/schema#",
  3. "type": "object",
  4. "id": "fields_schema_v1.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. "cpu_quota": {"type": ["number", "string"]},
  29. "cpuset": {"type": "string"},
  30. "devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  31. "dns": {"$ref": "#/definitions/string_or_list"},
  32. "dns_search": {"$ref": "#/definitions/string_or_list"},
  33. "dockerfile": {"type": "string"},
  34. "domainname": {"type": "string"},
  35. "entrypoint": {"$ref": "#/definitions/string_or_list"},
  36. "env_file": {"$ref": "#/definitions/string_or_list"},
  37. "environment": {"$ref": "#/definitions/list_or_dict"},
  38. "expose": {
  39. "type": "array",
  40. "items": {
  41. "type": ["string", "number"],
  42. "format": "expose"
  43. },
  44. "uniqueItems": true
  45. },
  46. "extends": {
  47. "oneOf": [
  48. {
  49. "type": "string"
  50. },
  51. {
  52. "type": "object",
  53. "properties": {
  54. "service": {"type": "string"},
  55. "file": {"type": "string"}
  56. },
  57. "required": ["service"],
  58. "additionalProperties": false
  59. }
  60. ]
  61. },
  62. "extra_hosts": {"$ref": "#/definitions/list_or_dict"},
  63. "external_links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  64. "hostname": {"type": "string"},
  65. "image": {"type": "string"},
  66. "ipc": {"type": "string"},
  67. "labels": {"$ref": "#/definitions/list_or_dict"},
  68. "links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  69. "log_driver": {"type": "string"},
  70. "log_opt": {"type": "object"},
  71. "mac_address": {"type": "string"},
  72. "mem_limit": {"type": ["number", "string"]},
  73. "memswap_limit": {"type": ["number", "string"]},
  74. "net": {"type": "string"},
  75. "pid": {"type": ["string", "null"]},
  76. "ports": {
  77. "type": "array",
  78. "items": {
  79. "type": ["string", "number"],
  80. "format": "ports"
  81. },
  82. "uniqueItems": true
  83. },
  84. "privileged": {"type": "boolean"},
  85. "read_only": {"type": "boolean"},
  86. "restart": {"type": "string"},
  87. "security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  88. "stdin_open": {"type": "boolean"},
  89. "tty": {"type": "boolean"},
  90. "ulimits": {
  91. "type": "object",
  92. "patternProperties": {
  93. "^[a-z]+$": {
  94. "oneOf": [
  95. {"type": "integer"},
  96. {
  97. "type":"object",
  98. "properties": {
  99. "hard": {"type": "integer"},
  100. "soft": {"type": "integer"}
  101. },
  102. "required": ["soft", "hard"],
  103. "additionalProperties": false
  104. }
  105. ]
  106. }
  107. }
  108. },
  109. "user": {"type": "string"},
  110. "volumes": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  111. "volume_driver": {"type": "string"},
  112. "volumes_from": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  113. "working_dir": {"type": "string"}
  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. {
  134. "type": "object",
  135. "patternProperties": {
  136. ".+": {
  137. "type": ["string", "number", "boolean", "null"],
  138. "format": "bool-value-in-mapping"
  139. }
  140. },
  141. "additionalProperties": false
  142. },
  143. {"type": "array", "items": {"type": "string"}, "uniqueItems": true}
  144. ]
  145. }
  146. }
  147. }