|
17 | 17 | },
|
18 | 18 |
|
19 | 19 | "include": {
|
20 |
| - "type": "array", |
21 |
| - "items": { |
22 |
| - "type": "object", |
23 |
| - "$ref": "#/definitions/include" |
24 |
| - }, |
25 |
| - "description": "compose sub-projects to be included." |
| 20 | + "oneOf": [ |
| 21 | + { |
| 22 | + "type": "array", |
| 23 | + "items": { |
| 24 | + "type": "object", |
| 25 | + "$ref": "#/definitions/include" |
| 26 | + }, |
| 27 | + "description": "compose sub-projects to be included." |
| 28 | + }, |
| 29 | + {"type": "null"} |
| 30 | + ] |
26 | 31 | },
|
27 | 32 |
|
28 | 33 | "services": {
|
|
103 | 108 | "context": {"type": "string"},
|
104 | 109 | "dockerfile": {"type": "string"},
|
105 | 110 | "dockerfile_inline": {"type": "string"},
|
106 |
| - "entitlements": {"type": "array", "items": {"type": "string"}}, |
| 111 | + "entitlements": {"$ref": "#/definitions/list_of_strings"}, |
107 | 112 | "args": {"$ref": "#/definitions/list_or_dict"},
|
108 | 113 | "ssh": {"$ref": "#/definitions/list_or_dict"},
|
109 | 114 | "labels": {"$ref": "#/definitions/list_or_dict"},
|
110 |
| - "cache_from": {"type": "array", "items": {"type": "string"}}, |
111 |
| - "cache_to": {"type": "array", "items": {"type": "string"}}, |
| 115 | + "cache_from": {"$ref": "#/definitions/list_of_strings"}, |
| 116 | + "cache_to": {"$ref": "#/definitions/list_of_strings"}, |
112 | 117 | "no_cache": {"type": ["boolean", "string"]},
|
113 | 118 | "additional_contexts": {"$ref": "#/definitions/list_or_dict"},
|
114 | 119 | "network": {"type": "string"},
|
|
119 | 124 | "isolation": {"type": "string"},
|
120 | 125 | "privileged": {"type": ["boolean", "string"]},
|
121 | 126 | "secrets": {"$ref": "#/definitions/service_config_or_secret"},
|
122 |
| - "tags": {"type": "array", "items": {"type": "string"}}, |
| 127 | + "tags": {"$ref": "#/definitions/list_of_strings"}, |
123 | 128 | "ulimits": {"$ref": "#/definitions/ulimits"},
|
124 |
| - "platforms": {"type": "array", "items": {"type": "string"}} |
| 129 | + "platforms": {"$ref": "#/definitions/list_of_strings"} |
125 | 130 | },
|
126 | 131 | "additionalProperties": false,
|
127 | 132 | "patternProperties": {"^x-": {}}
|
|
132 | 137 | "type": "object",
|
133 | 138 | "properties": {
|
134 | 139 | "device_read_bps": {
|
135 |
| - "type": "array", |
136 |
| - "items": {"$ref": "#/definitions/blkio_limit"} |
| 140 | + "$ref": "#/definitions/blkio_limit_list" |
137 | 141 | },
|
138 | 142 | "device_read_iops": {
|
139 |
| - "type": "array", |
140 |
| - "items": {"$ref": "#/definitions/blkio_limit"} |
| 143 | + "$ref": "#/definitions/blkio_limit_list" |
141 | 144 | },
|
142 | 145 | "device_write_bps": {
|
143 |
| - "type": "array", |
144 |
| - "items": {"$ref": "#/definitions/blkio_limit"} |
| 146 | + "$ref": "#/definitions/blkio_limit_list" |
145 | 147 | },
|
146 | 148 | "device_write_iops": {
|
147 |
| - "type": "array", |
148 |
| - "items": {"$ref": "#/definitions/blkio_limit"} |
| 149 | + "$ref": "#/definitions/blkio_limit_list" |
149 | 150 | },
|
150 | 151 | "weight": {"type": ["integer", "string"]},
|
151 | 152 | "weight_device": {
|
152 |
| - "type": "array", |
153 |
| - "items": {"$ref": "#/definitions/blkio_weight"} |
| 153 | + "$ref": "#/definitions/blkio_weight_list" |
154 | 154 | }
|
155 | 155 | },
|
156 | 156 | "additionalProperties": false
|
157 | 157 | },
|
158 |
| - "cap_add": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, |
159 |
| - "cap_drop": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, |
| 158 | + "cap_add": {"$ref": "#/definitions/list_of_unique_strings"}, |
| 159 | + "cap_drop": {"$ref": "#/definitions/list_of_unique_strings"}, |
160 | 160 | "cgroup": {"type": "string", "enum": ["host", "private"]},
|
161 | 161 | "cgroup_parent": {"type": "string"},
|
162 | 162 | "command": {"$ref": "#/definitions/command"},
|
|
189 | 189 | },
|
190 | 190 | "depends_on": {
|
191 | 191 | "oneOf": [
|
192 |
| - {"$ref": "#/definitions/list_of_strings"}, |
| 192 | + {"$ref": "#/definitions/list_of_unique_strings"}, |
193 | 193 | {
|
194 | 194 | "type": "object",
|
195 | 195 | "additionalProperties": false,
|
|
215 | 215 | }
|
216 | 216 | ]
|
217 | 217 | },
|
218 |
| - "device_cgroup_rules": {"$ref": "#/definitions/list_of_strings"}, |
219 |
| - "devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, |
| 218 | + "device_cgroup_rules": {"$ref": "#/definitions/list_of_unique_strings"}, |
| 219 | + "devices": {"$ref": "#/definitions/list_of_unique_strings"}, |
220 | 220 | "dns": {"$ref": "#/definitions/string_or_list"},
|
221 |
| - "dns_opt": {"type": "array","items": {"type": "string"}, "uniqueItems": true}, |
| 221 | + "dns_opt": {"$ref": "#/definitions/list_of_unique_strings"}, |
222 | 222 | "dns_search": {"$ref": "#/definitions/string_or_list"},
|
223 | 223 | "domainname": {"type": "string"},
|
224 | 224 | "entrypoint": {"$ref": "#/definitions/command"},
|
|
248 | 248 | }
|
249 | 249 | ]
|
250 | 250 | },
|
251 |
| - "external_links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, |
| 251 | + "external_links": {"$ref": "#/definitions/list_of_unique_strings"}, |
252 | 252 | "extra_hosts": {"$ref": "#/definitions/list_or_dict"},
|
253 | 253 | "group_add": {
|
254 | 254 | "type": "array",
|
|
264 | 264 | "ipc": {"type": "string"},
|
265 | 265 | "isolation": {"type": "string"},
|
266 | 266 | "labels": {"$ref": "#/definitions/list_or_dict"},
|
267 |
| - "links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, |
| 267 | + "links": {"$ref": "#/definitions/list_of_unique_strings"}, |
268 | 268 | "logging": {
|
269 | 269 | "type": "object",
|
270 | 270 |
|
|
288 | 288 | "network_mode": {"type": "string"},
|
289 | 289 | "networks": {
|
290 | 290 | "oneOf": [
|
291 |
| - {"$ref": "#/definitions/list_of_strings"}, |
| 291 | + {"$ref": "#/definitions/list_of_unique_strings"}, |
292 | 292 | {
|
293 | 293 | "type": "object",
|
294 | 294 | "patternProperties": {
|
|
297 | 297 | {
|
298 | 298 | "type": "object",
|
299 | 299 | "properties": {
|
300 |
| - "aliases": {"$ref": "#/definitions/list_of_strings"}, |
| 300 | + "aliases": {"$ref": "#/definitions/list_of_unique_strings"}, |
301 | 301 | "ipv4_address": {"type": "string"},
|
302 | 302 | "ipv6_address": {"type": "string"},
|
303 |
| - "link_local_ips": {"$ref": "#/definitions/list_of_strings"}, |
| 303 | + "link_local_ips": {"$ref": "#/definitions/list_of_unique_strings"}, |
304 | 304 | "mac_address": {"type": "string"},
|
305 | 305 | "driver_opts": {
|
306 | 306 | "type": "object",
|
|
354 | 354 | "uniqueItems": true
|
355 | 355 | },
|
356 | 356 | "privileged": {"type": ["boolean", "string"]},
|
357 |
| - "profiles": {"$ref": "#/definitions/list_of_strings"}, |
| 357 | + "profiles": {"$ref": "#/definitions/list_of_unique_strings"}, |
358 | 358 | "pull_policy": {"type": "string", "enum": [
|
359 | 359 | "always", "never", "if_not_present", "build", "missing"
|
360 | 360 | ]},
|
|
366 | 366 | "scale": {
|
367 | 367 | "type": ["integer", "string"]
|
368 | 368 | },
|
369 |
| - "security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, |
| 369 | + "security_opt": {"$ref": "#/definitions/list_of_unique_strings"}, |
370 | 370 | "shm_size": {"type": ["number", "string"]},
|
371 | 371 | "secrets": {"$ref": "#/definitions/service_config_or_secret"},
|
372 | 372 | "sysctls": {"$ref": "#/definitions/list_or_dict"},
|
|
436 | 436 | "uniqueItems": true
|
437 | 437 | },
|
438 | 438 | "volumes_from": {
|
439 |
| - "type": "array", |
440 |
| - "items": {"type": "string"}, |
441 |
| - "uniqueItems": true |
| 439 | + "$ref": "#/definitions/list_of_unique_strings" |
442 | 440 | },
|
443 | 441 | "working_dir": {"type": "string"}
|
444 | 442 | },
|
|
456 | 454 | "test": {
|
457 | 455 | "oneOf": [
|
458 | 456 | {"type": "string"},
|
459 |
| - {"type": "array", "items": {"type": "string"}} |
| 457 | + {"$ref": "#/definitions/list_of_strings"} |
460 | 458 | ]
|
461 | 459 | },
|
462 | 460 | "timeout": {"type": "string"},
|
|
476 | 474 | "type": "object",
|
477 | 475 | "required": ["path", "action"],
|
478 | 476 | "properties": {
|
479 |
| - "ignore": {"type": "array", "items": {"type": "string"}}, |
| 477 | + "ignore": {"$ref": "#/definitions/list_of_strings"}, |
480 | 478 | "path": {"type": "string"},
|
481 | 479 | "action": {"type": "string", "enum": ["rebuild", "sync", "sync+restart"]},
|
482 | 480 | "target": {"type": "string"}
|
|
567 | 565 | "placement": {
|
568 | 566 | "type": "object",
|
569 | 567 | "properties": {
|
570 |
| - "constraints": {"type": "array", "items": {"type": "string"}}, |
| 568 | + "constraints": {"$ref": "#/definitions/list_of_strings"}, |
571 | 569 | "preferences": {
|
572 | 570 | "type": "array",
|
573 | 571 | "items": {
|
|
616 | 614 | "items": {
|
617 | 615 | "type": "object",
|
618 | 616 | "properties": {
|
619 |
| - "capabilities": {"$ref": "#/definitions/list_of_strings"}, |
| 617 | + "capabilities": {"$ref": "#/definitions/list_of_unique_strings"}, |
620 | 618 | "count": {"type": ["string", "integer"]},
|
621 |
| - "device_ids": {"$ref": "#/definitions/list_of_strings"}, |
| 619 | + "device_ids": {"$ref": "#/definitions/list_of_unique_strings"}, |
622 | 620 | "driver":{"type": "string"},
|
623 | 621 | "options":{"$ref": "#/definitions/list_or_dict"}
|
624 | 622 | },
|
|
790 | 788 | "oneOf": [
|
791 | 789 | {"type": "null"},
|
792 | 790 | {"type": "string"},
|
793 |
| - {"type": "array","items": {"type": "string"}} |
| 791 | + {"type": "array", "items": {"type": "string"}} |
794 | 792 | ]
|
795 | 793 | },
|
796 | 794 |
|
797 | 795 | "env_file": {
|
798 | 796 | "oneOf": [
|
| 797 | + {"type": "null"}, |
799 | 798 | {"type": "string"},
|
800 | 799 | {
|
801 | 800 | "type": "array",
|
|
827 | 826 | "string_or_list": {
|
828 | 827 | "oneOf": [
|
829 | 828 | {"type": "string"},
|
830 |
| - {"$ref": "#/definitions/list_of_strings"} |
| 829 | + {"$ref": "#/definitions/list_of_unique_strings"} |
| 830 | + ] |
| 831 | + }, |
| 832 | + |
| 833 | + "list_of_unique_strings": { |
| 834 | + "oneOf": [ |
| 835 | + { |
| 836 | + "type": "array", |
| 837 | + "items": {"type": "string"}, |
| 838 | + "uniqueItems": true |
| 839 | + }, |
| 840 | + {"type": "null"} |
831 | 841 | ]
|
832 | 842 | },
|
833 | 843 |
|
834 | 844 | "list_of_strings": {
|
835 |
| - "type": "array", |
836 |
| - "items": {"type": "string"}, |
837 |
| - "uniqueItems": true |
| 845 | + "oneOf": [ |
| 846 | + { |
| 847 | + "type": "array", |
| 848 | + "items": {"type": "string"} |
| 849 | + }, |
| 850 | + {"type": "null"} |
| 851 | + ] |
838 | 852 | },
|
839 | 853 |
|
840 | 854 | "list_or_dict": {
|
|
848 | 862 | },
|
849 | 863 | "additionalProperties": false
|
850 | 864 | },
|
851 |
| - {"type": "array", "items": {"type": "string"}, "uniqueItems": true} |
| 865 | + {"$ref": "#/definitions/list_of_unique_strings"} |
852 | 866 | ]
|
853 | 867 | },
|
854 | 868 |
|
|
860 | 874 | },
|
861 | 875 | "additionalProperties": false
|
862 | 876 | },
|
| 877 | + "blkio_limit_list": { |
| 878 | + "oneOf": [ |
| 879 | + {"type": "array", "items": {"$ref": "#/definitions/blkio_limit"}}, |
| 880 | + {"type": "null"} |
| 881 | + ] |
| 882 | + }, |
| 883 | + |
863 | 884 | "blkio_weight": {
|
864 | 885 | "type": "object",
|
865 | 886 | "properties": {
|
|
868 | 889 | },
|
869 | 890 | "additionalProperties": false
|
870 | 891 | },
|
| 892 | + "blkio_weight_list": { |
| 893 | + "oneOf": [ |
| 894 | + {"type": "array", "items": {"$ref": "#/definitions/blkio_weight"}}, |
| 895 | + {"type": "null"} |
| 896 | + ] |
| 897 | + }, |
| 898 | + |
871 | 899 | "service_config_or_secret": {
|
872 |
| - "type": "array", |
873 |
| - "items": { |
874 |
| - "oneOf": [ |
875 |
| - {"type": "string"}, |
876 |
| - { |
877 |
| - "type": "object", |
878 |
| - "properties": { |
879 |
| - "source": {"type": "string"}, |
880 |
| - "target": {"type": "string"}, |
881 |
| - "uid": {"type": "string"}, |
882 |
| - "gid": {"type": "string"}, |
883 |
| - "mode": {"type": ["number", "string"]} |
884 |
| - }, |
885 |
| - "additionalProperties": false, |
886 |
| - "patternProperties": {"^x-": {}} |
| 900 | + "oneOf": [ |
| 901 | + {"type": "null"}, |
| 902 | + { |
| 903 | + "type": "array", |
| 904 | + "items": { |
| 905 | + "oneOf": [ |
| 906 | + {"type": "string"}, |
| 907 | + { |
| 908 | + "type": "object", |
| 909 | + "properties": { |
| 910 | + "source": {"type": "string"}, |
| 911 | + "target": {"type": "string"}, |
| 912 | + "uid": {"type": "string"}, |
| 913 | + "gid": {"type": "string"}, |
| 914 | + "mode": {"type": ["number", "string"]} |
| 915 | + }, |
| 916 | + "additionalProperties": false, |
| 917 | + "patternProperties": {"^x-": {}} |
| 918 | + } |
| 919 | + ] |
887 | 920 | }
|
888 |
| - ] |
889 |
| - } |
| 921 | + } |
| 922 | + ] |
890 | 923 | },
|
891 | 924 | "ulimits": {
|
892 | 925 | "type": "object",
|
|
0 commit comments