github.com/AliyunContainerService/cli@v0.0.0-20181009023821-814ced4b30d0/cli/compose/schema/data/config_schema_v3.4.json (about)

     1  {
     2    "$schema": "http://json-schema.org/draft-04/schema#",
     3    "id": "config_schema_v3.4.json",
     4    "type": "object",
     5    "required": ["version"],
     6  
     7    "properties": {
     8      "version": {
     9        "type": "string"
    10      },
    11  
    12      "services": {
    13        "id": "#/properties/services",
    14        "type": "object",
    15        "patternProperties": {
    16          "^[a-zA-Z0-9._-]+$": {
    17            "$ref": "#/definitions/service"
    18          }
    19        },
    20        "additionalProperties": false
    21      },
    22  
    23      "networks": {
    24        "id": "#/properties/networks",
    25        "type": "object",
    26        "patternProperties": {
    27          "^[a-zA-Z0-9._-]+$": {
    28            "$ref": "#/definitions/network"
    29          }
    30        }
    31      },
    32  
    33      "volumes": {
    34        "id": "#/properties/volumes",
    35        "type": "object",
    36        "patternProperties": {
    37          "^[a-zA-Z0-9._-]+$": {
    38            "$ref": "#/definitions/volume"
    39          }
    40        },
    41        "additionalProperties": false
    42      },
    43  
    44      "secrets": {
    45        "id": "#/properties/secrets",
    46        "type": "object",
    47        "patternProperties": {
    48          "^[a-zA-Z0-9._-]+$": {
    49            "$ref": "#/definitions/secret"
    50          }
    51        },
    52        "additionalProperties": false
    53      },
    54  
    55      "configs": {
    56        "id": "#/properties/configs",
    57        "type": "object",
    58        "patternProperties": {
    59          "^[a-zA-Z0-9._-]+$": {
    60            "$ref": "#/definitions/config"
    61          }
    62        },
    63        "additionalProperties": false
    64      }
    65    },
    66  
    67    "patternProperties": {"^x-": {}},
    68    "additionalProperties": false,
    69  
    70    "definitions": {
    71  
    72      "service": {
    73        "id": "#/definitions/service",
    74        "type": "object",
    75  
    76        "properties": {
    77          "deploy": {"$ref": "#/definitions/deployment"},
    78          "build": {
    79            "oneOf": [
    80              {"type": "string"},
    81              {
    82                "type": "object",
    83                "properties": {
    84                  "context": {"type": "string"},
    85                  "dockerfile": {"type": "string"},
    86                  "args": {"$ref": "#/definitions/list_or_dict"},
    87                  "labels": {"$ref": "#/definitions/list_or_dict"},
    88                  "cache_from": {"$ref": "#/definitions/list_of_strings"},
    89                  "network": {"type": "string"},
    90                  "target": {"type": "string"}
    91                },
    92                "additionalProperties": false
    93              }
    94            ]
    95          },
    96          "cap_add": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
    97          "cap_drop": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
    98          "cgroup_parent": {"type": "string"},
    99          "command": {
   100            "oneOf": [
   101              {"type": "string"},
   102              {"type": "array", "items": {"type": "string"}}
   103            ]
   104          },
   105          "configs": {
   106            "type": "array",
   107            "items": {
   108              "oneOf": [
   109                {"type": "string"},
   110                {
   111                  "type": "object",
   112                  "properties": {
   113                    "source": {"type": "string"},
   114                    "target": {"type": "string"},
   115                    "uid": {"type": "string"},
   116                    "gid": {"type": "string"},
   117                    "mode": {"type": "number"}
   118                  }
   119                }
   120              ]
   121            }
   122          },
   123          "container_name": {"type": "string"},
   124          "credential_spec": {"type": "object", "properties": {
   125            "file": {"type": "string"},
   126            "registry": {"type": "string"}
   127          }},
   128          "depends_on": {"$ref": "#/definitions/list_of_strings"},
   129          "devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
   130          "dns": {"$ref": "#/definitions/string_or_list"},
   131          "dns_search": {"$ref": "#/definitions/string_or_list"},
   132          "domainname": {"type": "string"},
   133          "entrypoint": {
   134            "oneOf": [
   135              {"type": "string"},
   136              {"type": "array", "items": {"type": "string"}}
   137            ]
   138          },
   139          "env_file": {"$ref": "#/definitions/string_or_list"},
   140          "environment": {"$ref": "#/definitions/list_or_dict"},
   141  
   142          "expose": {
   143            "type": "array",
   144            "items": {
   145              "type": ["string", "number"],
   146              "format": "expose"
   147            },
   148            "uniqueItems": true
   149          },
   150  
   151          "external_links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
   152          "extra_hosts": {"$ref": "#/definitions/list_or_dict"},
   153          "healthcheck": {"$ref": "#/definitions/healthcheck"},
   154          "hostname": {"type": "string"},
   155          "image": {"type": "string"},
   156          "ipc": {"type": "string"},
   157          "labels": {"$ref": "#/definitions/list_or_dict"},
   158          "links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
   159  
   160          "logging": {
   161              "type": "object",
   162  
   163              "properties": {
   164                  "driver": {"type": "string"},
   165                  "options": {
   166                    "type": "object",
   167                    "patternProperties": {
   168                      "^.+$": {"type": ["string", "number", "null"]}
   169                    }
   170                  }
   171              },
   172              "additionalProperties": false
   173          },
   174  
   175          "mac_address": {"type": "string"},
   176          "network_mode": {"type": "string"},
   177  
   178          "networks": {
   179            "oneOf": [
   180              {"$ref": "#/definitions/list_of_strings"},
   181              {
   182                "type": "object",
   183                "patternProperties": {
   184                  "^[a-zA-Z0-9._-]+$": {
   185                    "oneOf": [
   186                      {
   187                        "type": "object",
   188                        "properties": {
   189                          "aliases": {"$ref": "#/definitions/list_of_strings"},
   190                          "ipv4_address": {"type": "string"},
   191                          "ipv6_address": {"type": "string"}
   192                        },
   193                        "additionalProperties": false
   194                      },
   195                      {"type": "null"}
   196                    ]
   197                  }
   198                },
   199                "additionalProperties": false
   200              }
   201            ]
   202          },
   203          "pid": {"type": ["string", "null"]},
   204  
   205          "ports": {
   206            "type": "array",
   207            "items": {
   208              "oneOf": [
   209                {"type": "number", "format": "ports"},
   210                {"type": "string", "format": "ports"},
   211                {
   212                  "type": "object",
   213                  "properties": {
   214                    "mode": {"type": "string"},
   215                    "target": {"type": "integer"},
   216                    "published": {"type": "integer"},
   217                    "protocol": {"type": "string"}
   218                  },
   219                  "additionalProperties": false
   220                }
   221              ]
   222            },
   223            "uniqueItems": true
   224          },
   225  
   226          "privileged": {"type": "boolean"},
   227          "read_only": {"type": "boolean"},
   228          "restart": {"type": "string"},
   229          "security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
   230          "shm_size": {"type": ["number", "string"]},
   231          "secrets": {
   232            "type": "array",
   233            "items": {
   234              "oneOf": [
   235                {"type": "string"},
   236                {
   237                  "type": "object",
   238                  "properties": {
   239                    "source": {"type": "string"},
   240                    "target": {"type": "string"},
   241                    "uid": {"type": "string"},
   242                    "gid": {"type": "string"},
   243                    "mode": {"type": "number"}
   244                  }
   245                }
   246              ]
   247            }
   248          },
   249          "sysctls": {"$ref": "#/definitions/list_or_dict"},
   250          "stdin_open": {"type": "boolean"},
   251          "stop_grace_period": {"type": "string", "format": "duration"},
   252          "stop_signal": {"type": "string"},
   253          "tmpfs": {"$ref": "#/definitions/string_or_list"},
   254          "tty": {"type": "boolean"},
   255          "ulimits": {
   256            "type": "object",
   257            "patternProperties": {
   258              "^[a-z]+$": {
   259                "oneOf": [
   260                  {"type": "integer"},
   261                  {
   262                    "type":"object",
   263                    "properties": {
   264                      "hard": {"type": "integer"},
   265                      "soft": {"type": "integer"}
   266                    },
   267                    "required": ["soft", "hard"],
   268                    "additionalProperties": false
   269                  }
   270                ]
   271              }
   272            }
   273          },
   274          "user": {"type": "string"},
   275          "userns_mode": {"type": "string"},
   276          "volumes": {
   277            "type": "array",
   278            "items": {
   279              "oneOf": [
   280                {"type": "string"},
   281                {
   282                  "type": "object",
   283                  "required": ["type"],
   284                  "properties": {
   285                    "type": {"type": "string"},
   286                    "source": {"type": "string"},
   287                    "target": {"type": "string"},
   288                    "read_only": {"type": "boolean"},
   289                    "consistency": {"type": "string"},
   290                    "bind": {
   291                      "type": "object",
   292                      "properties": {
   293                        "propagation": {"type": "string"}
   294                      }
   295                    },
   296                    "volume": {
   297                      "type": "object",
   298                      "properties": {
   299                        "nocopy": {"type": "boolean"}
   300                      }
   301                    }
   302                  },
   303                  "additionalProperties": false
   304                }
   305              ],
   306              "uniqueItems": true
   307            }
   308          },
   309          "working_dir": {"type": "string"}
   310        },
   311        "additionalProperties": false
   312      },
   313  
   314      "healthcheck": {
   315        "id": "#/definitions/healthcheck",
   316        "type": "object",
   317        "additionalProperties": false,
   318        "properties": {
   319          "disable": {"type": "boolean"},
   320          "interval": {"type": "string", "format": "duration"},
   321          "retries": {"type": "number"},
   322          "test": {
   323            "oneOf": [
   324              {"type": "string"},
   325              {"type": "array", "items": {"type": "string"}}
   326            ]
   327          },
   328          "timeout": {"type": "string", "format": "duration"},
   329          "start_period": {"type": "string", "format": "duration"}
   330        }
   331      },
   332      "deployment": {
   333        "id": "#/definitions/deployment",
   334        "type": ["object", "null"],
   335        "properties": {
   336          "mode": {"type": "string"},
   337          "endpoint_mode": {"type": "string"},
   338          "replicas": {"type": "integer"},
   339          "labels": {"$ref": "#/definitions/list_or_dict"},
   340          "update_config": {
   341            "type": "object",
   342            "properties": {
   343              "parallelism": {"type": "integer"},
   344              "delay": {"type": "string", "format": "duration"},
   345              "failure_action": {"type": "string"},
   346              "monitor": {"type": "string", "format": "duration"},
   347              "max_failure_ratio": {"type": "number"},
   348              "order": {"type": "string", "enum": [
   349                "start-first", "stop-first"
   350              ]}
   351            },
   352            "additionalProperties": false
   353          },
   354          "resources": {
   355            "type": "object",
   356            "properties": {
   357              "limits": {"$ref": "#/definitions/resource"},
   358              "reservations": {"$ref": "#/definitions/resource"}
   359            },
   360            "additionalProperties": false
   361          },
   362          "restart_policy": {
   363            "type": "object",
   364            "properties": {
   365              "condition": {"type": "string"},
   366              "delay": {"type": "string", "format": "duration"},
   367              "max_attempts": {"type": "integer"},
   368              "window": {"type": "string", "format": "duration"}
   369            },
   370            "additionalProperties": false
   371          },
   372          "placement": {
   373            "type": "object",
   374            "properties": {
   375              "constraints": {"type": "array", "items": {"type": "string"}},
   376              "preferences": {
   377                "type": "array",
   378                "items": {
   379                  "type": "object",
   380                  "properties": {
   381                    "spread": {"type": "string"}
   382                  },
   383                  "additionalProperties": false
   384                }
   385              }
   386            },
   387            "additionalProperties": false
   388          }
   389        },
   390        "additionalProperties": false
   391      },
   392  
   393      "resource": {
   394        "id": "#/definitions/resource",
   395        "type": "object",
   396        "properties": {
   397          "cpus": {"type": "string"},
   398          "memory": {"type": "string"}
   399        },
   400        "additionalProperties": false
   401      },
   402  
   403      "network": {
   404        "id": "#/definitions/network",
   405        "type": ["object", "null"],
   406        "properties": {
   407          "driver": {"type": "string"},
   408          "driver_opts": {
   409            "type": "object",
   410            "patternProperties": {
   411              "^.+$": {"type": ["string", "number"]}
   412            }
   413          },
   414          "ipam": {
   415            "type": "object",
   416            "properties": {
   417              "driver": {"type": "string"},
   418              "config": {
   419                "type": "array",
   420                "items": {
   421                  "type": "object",
   422                  "properties": {
   423                    "subnet": {"type": "string"}
   424                  },
   425                  "additionalProperties": false
   426                }
   427              }
   428            },
   429            "additionalProperties": false
   430          },
   431          "external": {
   432            "type": ["boolean", "object"],
   433            "properties": {
   434              "name": {"type": "string"}
   435            },
   436            "additionalProperties": false
   437          },
   438          "internal": {"type": "boolean"},
   439          "attachable": {"type": "boolean"},
   440          "labels": {"$ref": "#/definitions/list_or_dict"}
   441        },
   442        "additionalProperties": false
   443      },
   444  
   445      "volume": {
   446        "id": "#/definitions/volume",
   447        "type": ["object", "null"],
   448        "properties": {
   449          "name": {"type": "string"},
   450          "driver": {"type": "string"},
   451          "driver_opts": {
   452            "type": "object",
   453            "patternProperties": {
   454              "^.+$": {"type": ["string", "number"]}
   455            }
   456          },
   457          "external": {
   458            "type": ["boolean", "object"],
   459            "properties": {
   460              "name": {"type": "string"}
   461            },
   462            "additionalProperties": false
   463          },
   464          "labels": {"$ref": "#/definitions/list_or_dict"}
   465        },
   466        "additionalProperties": false
   467      },
   468  
   469      "secret": {
   470        "id": "#/definitions/secret",
   471        "type": "object",
   472        "properties": {
   473          "file": {"type": "string"},
   474          "external": {
   475            "type": ["boolean", "object"],
   476            "properties": {
   477              "name": {"type": "string"}
   478            }
   479          },
   480          "labels": {"$ref": "#/definitions/list_or_dict"}
   481        },
   482        "additionalProperties": false
   483      },
   484  
   485      "config": {
   486        "id": "#/definitions/config",
   487        "type": "object",
   488        "properties": {
   489          "file": {"type": "string"},
   490          "external": {
   491            "type": ["boolean", "object"],
   492            "properties": {
   493              "name": {"type": "string"}
   494            }
   495          },
   496          "labels": {"$ref": "#/definitions/list_or_dict"}
   497        },
   498        "additionalProperties": false
   499      },
   500  
   501      "string_or_list": {
   502        "oneOf": [
   503          {"type": "string"},
   504          {"$ref": "#/definitions/list_of_strings"}
   505        ]
   506      },
   507  
   508      "list_of_strings": {
   509        "type": "array",
   510        "items": {"type": "string"},
   511        "uniqueItems": true
   512      },
   513  
   514      "list_or_dict": {
   515        "oneOf": [
   516          {
   517            "type": "object",
   518            "patternProperties": {
   519              ".+": {
   520                "type": ["string", "number", "null"]
   521              }
   522            },
   523            "additionalProperties": false
   524          },
   525          {"type": "array", "items": {"type": "string"}, "uniqueItems": true}
   526        ]
   527      },
   528  
   529      "constraints": {
   530        "service": {
   531          "id": "#/definitions/constraints/service",
   532          "anyOf": [
   533            {"required": ["build"]},
   534            {"required": ["image"]}
   535          ],
   536          "properties": {
   537            "build": {
   538              "required": ["context"]
   539            }
   540          }
   541        }
   542      }
   543    }
   544  }