diff --git a/schema/compose-spec.json b/schema/compose-spec.json index cbe51db7..5ec6218b 100644 --- a/schema/compose-spec.json +++ b/schema/compose-spec.json @@ -13,7 +13,6 @@ "name": { "type": "string", - "pattern": "^[a-z0-9][a-z0-9_-]*$", "description": "define the Compose project name, until user defines one explicitly." }, @@ -94,7 +93,7 @@ "develop": {"$ref": "#/definitions/development"}, "deploy": {"$ref": "#/definitions/deployment"}, "annotations": {"$ref": "#/definitions/list_or_dict"}, - "attach": {"type": "boolean"}, + "attach": {"type": ["boolean", "string"]}, "build": { "oneOf": [ {"type": "string"}, @@ -110,15 +109,15 @@ "labels": {"$ref": "#/definitions/list_or_dict"}, "cache_from": {"type": "array", "items": {"type": "string"}}, "cache_to": {"type": "array", "items": {"type": "string"}}, - "no_cache": {"type": "boolean"}, + "no_cache": {"type": ["boolean", "string"]}, "additional_contexts": {"$ref": "#/definitions/list_or_dict"}, "network": {"type": "string"}, - "pull": {"type": "boolean"}, + "pull": {"type": ["boolean", "string"]}, "target": {"type": "string"}, "shm_size": {"type": ["integer", "string"]}, "extra_hosts": {"$ref": "#/definitions/list_or_dict"}, "isolation": {"type": "string"}, - "privileged": {"type": "boolean"}, + "privileged": {"type": ["boolean", "string"]}, "secrets": {"$ref": "#/definitions/service_config_or_secret"}, "tags": {"type": "array", "items": {"type": "string"}}, "ulimits": {"$ref": "#/definitions/ulimits"}, @@ -148,7 +147,7 @@ "type": "array", "items": {"$ref": "#/definitions/blkio_limit"} }, - "weight": {"type": "integer"}, + "weight": {"type": ["integer", "string"]}, "weight_device": { "type": "array", "items": {"$ref": "#/definitions/blkio_weight"} @@ -163,8 +162,14 @@ "command": {"$ref": "#/definitions/command"}, "configs": {"$ref": "#/definitions/service_config_or_secret"}, "container_name": {"type": "string"}, - "cpu_count": {"type": "integer", "minimum": 0}, - "cpu_percent": {"type": "integer", "minimum": 0, "maximum": 100}, + "cpu_count": {"oneOf": [ + {"type": "string"}, + {"type": "integer", "minimum": 0} + ]}, + "cpu_percent": {"oneOf": [ + {"type": "string"}, + {"type": "integer", "minimum": 0, "maximum": 100} + ]}, "cpu_shares": {"type": ["number", "string"]}, "cpu_quota": {"type": ["number", "string"]}, "cpu_period": {"type": ["number", "string"]}, @@ -192,8 +197,9 @@ "^[a-zA-Z0-9._-]+$": { "type": "object", "additionalProperties": false, + "patternProperties": {"^x-": {}}, "properties": { - "restart": {"type": "boolean"}, + "restart": {"type": ["boolean", "string"]}, "required": { "type": "boolean", "default": true @@ -254,7 +260,7 @@ "healthcheck": {"$ref": "#/definitions/healthcheck"}, "hostname": {"type": "string"}, "image": {"type": "string"}, - "init": {"type": "boolean"}, + "init": {"type": ["boolean", "string"]}, "ipc": {"type": "string"}, "isolation": {"type": "string"}, "labels": {"$ref": "#/definitions/list_or_dict"}, @@ -277,7 +283,7 @@ "mac_address": {"type": "string"}, "mem_limit": {"type": ["number", "string"]}, "mem_reservation": {"type": ["string", "integer"]}, - "mem_swappiness": {"type": "integer"}, + "mem_swappiness": {"type": ["integer", "string"]}, "memswap_limit": {"type": ["number", "string"]}, "network_mode": {"type": "string"}, "networks": { @@ -296,6 +302,12 @@ "ipv6_address": {"type": "string"}, "link_local_ips": {"$ref": "#/definitions/list_of_strings"}, "mac_address": {"type": "string"}, + "driver_opts": { + "type": "object", + "patternProperties": { + "^.+$": {"type": ["string", "number"]} + } + }, "priority": {"type": "number"} }, "additionalProperties": false, @@ -309,8 +321,11 @@ } ] }, - "oom_kill_disable": {"type": "boolean"}, - "oom_score_adj": {"type": "integer", "minimum": -1000, "maximum": 1000}, + "oom_kill_disable": {"type": ["boolean", "string"]}, + "oom_score_adj": {"oneOf": [ + {"type": "string"}, + {"type": "integer", "minimum": -1000, "maximum": 1000} + ]}, "pid": {"type": ["string", "null"]}, "pids_limit": {"type": ["number", "string"]}, "platform": {"type": "string"}, @@ -318,15 +333,15 @@ "type": "array", "items": { "oneOf": [ - {"type": "number", "format": "ports"}, - {"type": "string", "format": "ports"}, + {"type": "number"}, + {"type": "string"}, { "type": "object", "properties": { "name": {"type": "string"}, "mode": {"type": "string"}, "host_ip": {"type": "string"}, - "target": {"type": "integer"}, + "target": {"type": ["integer", "string"]}, "published": {"type": ["string", "integer"]}, "protocol": {"type": "string"}, "app_protocol": {"type": "string"} @@ -338,29 +353,29 @@ }, "uniqueItems": true }, - "privileged": {"type": "boolean"}, + "privileged": {"type": ["boolean", "string"]}, "profiles": {"$ref": "#/definitions/list_of_strings"}, "pull_policy": {"type": "string", "enum": [ "always", "never", "if_not_present", "build", "missing" ]}, - "read_only": {"type": "boolean"}, + "read_only": {"type": ["boolean", "string"]}, "restart": {"type": "string"}, "runtime": { "type": "string" }, "scale": { - "type": "integer" + "type": ["integer", "string"] }, "security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, "shm_size": {"type": ["number", "string"]}, "secrets": {"$ref": "#/definitions/service_config_or_secret"}, "sysctls": {"$ref": "#/definitions/list_or_dict"}, - "stdin_open": {"type": "boolean"}, - "stop_grace_period": {"type": "string", "format": "duration"}, + "stdin_open": {"type": ["boolean", "string"]}, + "stop_grace_period": {"type": "string"}, "stop_signal": {"type": "string"}, "storage_opt": {"type": "object"}, "tmpfs": {"$ref": "#/definitions/string_or_list"}, - "tty": {"type": "boolean"}, + "tty": {"type": ["boolean", "string"]}, "ulimits": {"$ref": "#/definitions/ulimits"}, "user": {"type": "string"}, "uts": {"type": "string"}, @@ -377,13 +392,13 @@ "type": {"type": "string"}, "source": {"type": "string"}, "target": {"type": "string"}, - "read_only": {"type": "boolean"}, + "read_only": {"type": ["boolean", "string"]}, "consistency": {"type": "string"}, "bind": { "type": "object", "properties": { "propagation": {"type": "string"}, - "create_host_path": {"type": "boolean"}, + "create_host_path": {"type": ["boolean", "string"]}, "selinux": {"type": "string", "enum": ["z", "Z"]} }, "additionalProperties": false, @@ -392,7 +407,7 @@ "volume": { "type": "object", "properties": { - "nocopy": {"type": "boolean"}, + "nocopy": {"type": ["boolean", "string"]}, "subpath": {"type": "string"} }, "additionalProperties": false, @@ -407,7 +422,7 @@ {"type": "string"} ] }, - "mode": {"type": "number"} + "mode": {"type": ["number", "string"]} }, "additionalProperties": false, "patternProperties": {"^x-": {}} @@ -435,18 +450,18 @@ "id": "#/definitions/healthcheck", "type": "object", "properties": { - "disable": {"type": "boolean"}, - "interval": {"type": "string", "format": "duration"}, - "retries": {"type": "number"}, + "disable": {"type": ["boolean", "string"]}, + "interval": {"type": "string"}, + "retries": {"type": ["number", "string"]}, "test": { "oneOf": [ {"type": "string"}, {"type": "array", "items": {"type": "string"}} ] }, - "timeout": {"type": "string", "format": "duration"}, - "start_period": {"type": "string", "format": "duration"}, - "start_interval": {"type": "string", "format": "duration"} + "timeout": {"type": "string"}, + "start_period": {"type": "string"}, + "start_interval": {"type": "string"} }, "additionalProperties": false, "patternProperties": {"^x-": {}} @@ -478,16 +493,16 @@ "properties": { "mode": {"type": "string"}, "endpoint_mode": {"type": "string"}, - "replicas": {"type": "integer"}, + "replicas": {"type": ["integer", "string"]}, "labels": {"$ref": "#/definitions/list_or_dict"}, "rollback_config": { "type": "object", "properties": { - "parallelism": {"type": "integer"}, - "delay": {"type": "string", "format": "duration"}, + "parallelism": {"type": ["integer", "string"]}, + "delay": {"type": "string"}, "failure_action": {"type": "string"}, - "monitor": {"type": "string", "format": "duration"}, - "max_failure_ratio": {"type": "number"}, + "monitor": {"type": "string"}, + "max_failure_ratio": {"type": ["number", "string"]}, "order": {"type": "string", "enum": [ "start-first", "stop-first" ]} @@ -498,11 +513,11 @@ "update_config": { "type": "object", "properties": { - "parallelism": {"type": "integer"}, - "delay": {"type": "string", "format": "duration"}, + "parallelism": {"type": ["integer", "string"]}, + "delay": {"type": "string"}, "failure_action": {"type": "string"}, - "monitor": {"type": "string", "format": "duration"}, - "max_failure_ratio": {"type": "number"}, + "monitor": {"type": "string"}, + "max_failure_ratio": {"type": ["number", "string"]}, "order": {"type": "string", "enum": [ "start-first", "stop-first" ]} @@ -518,7 +533,7 @@ "properties": { "cpus": {"type": ["number", "string"]}, "memory": {"type": "string"}, - "pids": {"type": "integer"} + "pids": {"type": ["integer", "string"]} }, "additionalProperties": false, "patternProperties": {"^x-": {}} @@ -542,9 +557,9 @@ "type": "object", "properties": { "condition": {"type": "string"}, - "delay": {"type": "string", "format": "duration"}, - "max_attempts": {"type": "integer"}, - "window": {"type": "string", "format": "duration"} + "delay": {"type": "string"}, + "max_attempts": {"type": ["integer", "string"]}, + "window": {"type": "string"} }, "additionalProperties": false, "patternProperties": {"^x-": {}} @@ -564,7 +579,7 @@ "patternProperties": {"^x-": {}} } }, - "max_replicas_per_node": {"type": "integer"} + "max_replicas_per_node": {"type": ["integer", "string"]} }, "additionalProperties": false, "patternProperties": {"^x-": {}} @@ -584,7 +599,7 @@ "type": "object", "properties": { "kind": {"type": "string"}, - "value": {"type": "number"} + "value": {"type": ["number", "string"]} }, "additionalProperties": false, "patternProperties": {"^x-": {}} @@ -649,7 +664,7 @@ "items": { "type": "object", "properties": { - "subnet": {"type": "string", "format": "subnet_ip_address"}, + "subnet": {"type": "string"}, "ip_range": {"type": "string"}, "gateway": {"type": "string"}, "aux_addresses": { @@ -672,7 +687,7 @@ "patternProperties": {"^x-": {}} }, "external": { - "type": ["boolean", "object"], + "type": ["boolean", "string", "object"], "properties": { "name": { "deprecated": true, @@ -682,9 +697,9 @@ "additionalProperties": false, "patternProperties": {"^x-": {}} }, - "internal": {"type": "boolean"}, - "enable_ipv6": {"type": "boolean"}, - "attachable": {"type": "boolean"}, + "internal": {"type": ["boolean", "string"]}, + "enable_ipv6": {"type": ["boolean", "string"]}, + "attachable": {"type": ["boolean", "string"]}, "labels": {"$ref": "#/definitions/list_or_dict"} }, "additionalProperties": false, @@ -704,7 +719,7 @@ } }, "external": { - "type": ["boolean", "object"], + "type": ["boolean", "string", "object"], "properties": { "name": { "deprecated": true, @@ -728,7 +743,7 @@ "environment": {"type": "string"}, "file": {"type": "string"}, "external": { - "type": ["boolean", "object"], + "type": ["boolean", "string", "object"], "properties": { "name": {"type": "string"} } @@ -756,7 +771,7 @@ "environment": {"type": "string"}, "file": {"type": "string"}, "external": { - "type": ["boolean", "object"], + "type": ["boolean", "string", "object"], "properties": { "name": { "deprecated": true, @@ -795,7 +810,7 @@ "type": "string" }, "required": { - "type": "boolean", + "type": ["boolean", "string"], "default": true } }, @@ -849,7 +864,7 @@ "type": "object", "properties": { "path": {"type": "string"}, - "weight": {"type": "integer"} + "weight": {"type": ["integer", "string"]} }, "additionalProperties": false }, @@ -865,7 +880,7 @@ "target": {"type": "string"}, "uid": {"type": "string"}, "gid": {"type": "string"}, - "mode": {"type": "number"} + "mode": {"type": ["number", "string"]} }, "additionalProperties": false, "patternProperties": {"^x-": {}} @@ -878,12 +893,12 @@ "patternProperties": { "^[a-z]+$": { "oneOf": [ - {"type": "integer"}, + {"type": ["integer", "string"]}, { "type": "object", "properties": { - "hard": {"type": "integer"}, - "soft": {"type": "integer"} + "hard": {"type": ["integer", "string"]}, + "soft": {"type": ["integer", "string"]} }, "required": ["soft", "hard"], "additionalProperties": false,