fields_schema.json 3.9 KB

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