fields_schema.json 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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": {
  19. "oneOf": [
  20. {"type": "number"},
  21. {"type": "string"}
  22. ]
  23. },
  24. "cpuset": {"type": "string"},
  25. "detach": {"type": "boolean"},
  26. "devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  27. "dns": {"$ref": "#/definitions/string_or_list"},
  28. "dns_search": {"$ref": "#/definitions/string_or_list"},
  29. "dockerfile": {"type": "string"},
  30. "domainname": {"type": "string"},
  31. "entrypoint": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  32. "env_file": {"$ref": "#/definitions/string_or_list"},
  33. "environment": {
  34. "oneOf": [
  35. {"type": "object"},
  36. {"type": "array", "items": {"type": "string"}, "uniqueItems": true}
  37. ]
  38. },
  39. "expose": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  40. "extends": {
  41. "type": "object",
  42. "properties": {
  43. "service": {"type": "string"},
  44. "file": {"type": "string"}
  45. },
  46. "required": ["service"],
  47. "additionalProperties": false
  48. },
  49. "extra_hosts": {"$ref": "#/definitions/list_or_dict"},
  50. "external_links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  51. "hostname": {"type": "string"},
  52. "image": {"type": "string"},
  53. "labels": {"$ref": "#/definitions/list_or_dict"},
  54. "links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  55. "log_driver": {"type": "string"},
  56. "log_opt": {"type": "object"},
  57. "mac_address": {"type": "string"},
  58. "mem_limit": {
  59. "oneOf": [
  60. {"type": "number"},
  61. {"type": "string"}
  62. ]
  63. },
  64. "memswap_limit": {
  65. "oneOf": [
  66. {"type": "number"},
  67. {"type": "string"}
  68. ]
  69. },
  70. "name": {"type": "string"},
  71. "net": {"type": "string"},
  72. "pid": {"type": ["string", "null"]},
  73. "ports": {
  74. "type": "array",
  75. "items": {
  76. "oneOf": [
  77. {
  78. "type": "string",
  79. "format": "ports"
  80. },
  81. {
  82. "type": "number",
  83. "format": "ports"
  84. }
  85. ]
  86. },
  87. "uniqueItems": true
  88. },
  89. "privileged": {"type": "boolean"},
  90. "read_only": {"type": "boolean"},
  91. "restart": {"type": "string"},
  92. "security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  93. "stdin_open": {"type": "string"},
  94. "tty": {"type": "string"},
  95. "user": {"type": "string"},
  96. "volumes": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  97. "volume_driver": {"type": "string"},
  98. "volumes_from": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  99. "working_dir": {"type": "string"}
  100. },
  101. "dependencies": {
  102. "memswap_limit": ["mem_limit"]
  103. },
  104. "additionalProperties": false
  105. },
  106. "string_or_list": {
  107. "oneOf": [
  108. {"type": "string"},
  109. {"$ref": "#/definitions/list_of_strings"}
  110. ]
  111. },
  112. "list_of_strings": {
  113. "type": "array",
  114. "items": {"type": "string"},
  115. "uniqueItems": true
  116. },
  117. "list_or_dict": {
  118. "oneOf": [
  119. {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
  120. {"type": "object"}
  121. ]
  122. }
  123. },
  124. "additionalProperties": false
  125. }