github.com/fabiokung/docker@v0.11.2-0.20170222101415-4534dcd49497/cli/compose/schema/data/config_schema_v3.1.json (about)

     1  {
     2    "$schema": "http://json-schema.org/draft-04/schema#",
     3    "id": "config_schema_v3.1.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  
    56    "additionalProperties": false,
    57  
    58    "definitions": {
    59  
    60      "service": {
    61        "id": "#/definitions/service",
    62        "type": "object",
    63  
    64        "properties": {
    65          "deploy": {"$ref": "#/definitions/deployment"},
    66          "build": {
    67            "oneOf": [
    68              {"type": "string"},
    69              {
    70                "type": "object",
    71                "properties": {
    72                  "context": {"type": "string"},
    73                  "dockerfile": {"type": "string"},
    74                  "args": {"$ref": "#/definitions/list_or_dict"}
    75                },
    76                "additionalProperties": false
    77              }
    78            ]
    79          },
    80          "cap_add": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
    81          "cap_drop": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
    82          "cgroup_parent": {"type": "string"},
    83          "command": {
    84            "oneOf": [
    85              {"type": "string"},
    86              {"type": "array", "items": {"type": "string"}}
    87            ]
    88          },
    89          "container_name": {"type": "string"},
    90          "depends_on": {"$ref": "#/definitions/list_of_strings"},
    91          "devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
    92          "dns": {"$ref": "#/definitions/string_or_list"},
    93          "dns_search": {"$ref": "#/definitions/string_or_list"},
    94          "domainname": {"type": "string"},
    95          "entrypoint": {
    96            "oneOf": [
    97              {"type": "string"},
    98              {"type": "array", "items": {"type": "string"}}
    99            ]
   100          },
   101          "env_file": {"$ref": "#/definitions/string_or_list"},
   102          "environment": {"$ref": "#/definitions/list_or_dict"},
   103  
   104          "expose": {
   105            "type": "array",
   106            "items": {
   107              "type": ["string", "number"],
   108              "format": "expose"
   109            },
   110            "uniqueItems": true
   111          },
   112  
   113          "external_links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
   114          "extra_hosts": {"$ref": "#/definitions/list_or_dict"},
   115          "healthcheck": {"$ref": "#/definitions/healthcheck"},
   116          "hostname": {"type": "string"},
   117          "image": {"type": "string"},
   118          "ipc": {"type": "string"},
   119          "labels": {"$ref": "#/definitions/list_or_dict"},
   120          "links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
   121  
   122          "logging": {
   123              "type": "object",
   124  
   125              "properties": {
   126                  "driver": {"type": "string"},
   127                  "options": {
   128                    "type": "object",
   129                    "patternProperties": {
   130                      "^.+$": {"type": ["string", "number", "null"]}
   131                    }
   132                  }
   133              },
   134              "additionalProperties": false
   135          },
   136  
   137          "mac_address": {"type": "string"},
   138          "network_mode": {"type": "string"},
   139  
   140          "networks": {
   141            "oneOf": [
   142              {"$ref": "#/definitions/list_of_strings"},
   143              {
   144                "type": "object",
   145                "patternProperties": {
   146                  "^[a-zA-Z0-9._-]+$": {
   147                    "oneOf": [
   148                      {
   149                        "type": "object",
   150                        "properties": {
   151                          "aliases": {"$ref": "#/definitions/list_of_strings"},
   152                          "ipv4_address": {"type": "string"},
   153                          "ipv6_address": {"type": "string"}
   154                        },
   155                        "additionalProperties": false
   156                      },
   157                      {"type": "null"}
   158                    ]
   159                  }
   160                },
   161                "additionalProperties": false
   162              }
   163            ]
   164          },
   165          "pid": {"type": ["string", "null"]},
   166  
   167          "ports": {
   168            "type": "array",
   169            "items": {
   170              "oneOf": [
   171                {"type": "number", "format": "ports"},
   172                {"type": "string", "format": "ports"},
   173                {
   174                  "type": "object",
   175                  "properties": {
   176                    "mode": {"type": "string"},
   177                    "target": {"type": "integer"},
   178                    "published": {"type": "integer"},
   179                    "protocol": {"type": "string"}
   180                  },
   181                  "additionalProperties": false
   182                }
   183              ]
   184            },
   185            "uniqueItems": true
   186          },
   187  
   188          "privileged": {"type": "boolean"},
   189          "read_only": {"type": "boolean"},
   190          "restart": {"type": "string"},
   191          "security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
   192          "shm_size": {"type": ["number", "string"]},
   193          "secrets": {
   194            "type": "array",
   195            "items": {
   196              "oneOf": [
   197                {"type": "string"},
   198                {
   199                  "type": "object",
   200                  "properties": {
   201                    "source": {"type": "string"},
   202                    "target": {"type": "string"},
   203                    "uid": {"type": "string"},
   204                    "gid": {"type": "string"},
   205                    "mode": {"type": "number"}
   206                  }
   207                }
   208              ]
   209            }
   210          },
   211          "sysctls": {"$ref": "#/definitions/list_or_dict"},
   212          "stdin_open": {"type": "boolean"},
   213          "stop_grace_period": {"type": "string", "format": "duration"},
   214          "stop_signal": {"type": "string"},
   215          "tmpfs": {"$ref": "#/definitions/string_or_list"},
   216          "tty": {"type": "boolean"},
   217          "ulimits": {
   218            "type": "object",
   219            "patternProperties": {
   220              "^[a-z]+$": {
   221                "oneOf": [
   222                  {"type": "integer"},
   223                  {
   224                    "type":"object",
   225                    "properties": {
   226                      "hard": {"type": "integer"},
   227                      "soft": {"type": "integer"}
   228                    },
   229                    "required": ["soft", "hard"],
   230                    "additionalProperties": false
   231                  }
   232                ]
   233              }
   234            }
   235          },
   236          "user": {"type": "string"},
   237          "userns_mode": {"type": "string"},
   238          "volumes": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
   239          "working_dir": {"type": "string"}
   240        },
   241        "additionalProperties": false
   242      },
   243  
   244      "healthcheck": {
   245        "id": "#/definitions/healthcheck",
   246        "type": "object",
   247        "additionalProperties": false,
   248        "properties": {
   249          "disable": {"type": "boolean"},
   250          "interval": {"type": "string"},
   251          "retries": {"type": "number"},
   252          "test": {
   253            "oneOf": [
   254              {"type": "string"},
   255              {"type": "array", "items": {"type": "string"}}
   256            ]
   257          },
   258          "timeout": {"type": "string"}
   259        }
   260      },
   261      "deployment": {
   262        "id": "#/definitions/deployment",
   263        "type": ["object", "null"],
   264        "properties": {
   265          "mode": {"type": "string"},
   266          "replicas": {"type": "integer"},
   267          "labels": {"$ref": "#/definitions/list_or_dict"},
   268          "update_config": {
   269            "type": "object",
   270            "properties": {
   271              "parallelism": {"type": "integer"},
   272              "delay": {"type": "string", "format": "duration"},
   273              "failure_action": {"type": "string"},
   274              "monitor": {"type": "string", "format": "duration"},
   275              "max_failure_ratio": {"type": "number"}
   276            },
   277            "additionalProperties": false
   278          },
   279          "resources": {
   280            "type": "object",
   281            "properties": {
   282              "limits": {"$ref": "#/definitions/resource"},
   283              "reservations": {"$ref": "#/definitions/resource"}
   284            }
   285          },
   286          "restart_policy": {
   287            "type": "object",
   288            "properties": {
   289              "condition": {"type": "string"},
   290              "delay": {"type": "string", "format": "duration"},
   291              "max_attempts": {"type": "integer"},
   292              "window": {"type": "string", "format": "duration"}
   293            },
   294            "additionalProperties": false
   295          },
   296          "placement": {
   297            "type": "object",
   298            "properties": {
   299              "constraints": {"type": "array", "items": {"type": "string"}}
   300            },
   301            "additionalProperties": false
   302          }
   303        },
   304        "additionalProperties": false
   305      },
   306  
   307      "resource": {
   308        "id": "#/definitions/resource",
   309        "type": "object",
   310        "properties": {
   311          "cpus": {"type": "string"},
   312          "memory": {"type": "string"}
   313        },
   314        "additionalProperties": false
   315      },
   316  
   317      "network": {
   318        "id": "#/definitions/network",
   319        "type": ["object", "null"],
   320        "properties": {
   321          "driver": {"type": "string"},
   322          "driver_opts": {
   323            "type": "object",
   324            "patternProperties": {
   325              "^.+$": {"type": ["string", "number"]}
   326            }
   327          },
   328          "ipam": {
   329            "type": "object",
   330            "properties": {
   331              "driver": {"type": "string"},
   332              "config": {
   333                "type": "array",
   334                "items": {
   335                  "type": "object",
   336                  "properties": {
   337                    "subnet": {"type": "string"}
   338                  },
   339                  "additionalProperties": false
   340                }
   341              }
   342            },
   343            "additionalProperties": false
   344          },
   345          "external": {
   346            "type": ["boolean", "object"],
   347            "properties": {
   348              "name": {"type": "string"}
   349            },
   350            "additionalProperties": false
   351          },
   352          "internal": {"type": "boolean"},
   353          "attachable": {"type": "boolean"},
   354          "labels": {"$ref": "#/definitions/list_or_dict"}
   355        },
   356        "additionalProperties": false
   357      },
   358  
   359      "volume": {
   360        "id": "#/definitions/volume",
   361        "type": ["object", "null"],
   362        "properties": {
   363          "driver": {"type": "string"},
   364          "driver_opts": {
   365            "type": "object",
   366            "patternProperties": {
   367              "^.+$": {"type": ["string", "number"]}
   368            }
   369          },
   370          "external": {
   371            "type": ["boolean", "object"],
   372            "properties": {
   373              "name": {"type": "string"}
   374            },
   375            "additionalProperties": false
   376          },
   377          "labels": {"$ref": "#/definitions/list_or_dict"}
   378        },
   379        "additionalProperties": false
   380      },
   381  
   382      "secret": {
   383        "id": "#/definitions/secret",
   384        "type": "object",
   385        "properties": {
   386          "file": {"type": "string"},
   387          "external": {
   388            "type": ["boolean", "object"],
   389            "properties": {
   390              "name": {"type": "string"}
   391            }
   392          },
   393          "labels": {"$ref": "#/definitions/list_or_dict"}
   394        },
   395        "additionalProperties": false
   396      },
   397  
   398      "string_or_list": {
   399        "oneOf": [
   400          {"type": "string"},
   401          {"$ref": "#/definitions/list_of_strings"}
   402        ]
   403      },
   404  
   405      "list_of_strings": {
   406        "type": "array",
   407        "items": {"type": "string"},
   408        "uniqueItems": true
   409      },
   410  
   411      "list_or_dict": {
   412        "oneOf": [
   413          {
   414            "type": "object",
   415            "patternProperties": {
   416              ".+": {
   417                "type": ["string", "number", "null"]
   418              }
   419            },
   420            "additionalProperties": false
   421          },
   422          {"type": "array", "items": {"type": "string"}, "uniqueItems": true}
   423        ]
   424      },
   425  
   426      "constraints": {
   427        "service": {
   428          "id": "#/definitions/constraints/service",
   429          "anyOf": [
   430            {"required": ["build"]},
   431            {"required": ["image"]}
   432          ],
   433          "properties": {
   434            "build": {
   435              "required": ["context"]
   436            }
   437          }
   438        }
   439      }
   440    }
   441  }