github.com/bdwilliams/libcompose@v0.3.1-0.20160826154243-d81a9bdacff0/script/config_schema_v2.0.json (about)

     1  {
     2    "$schema": "http://json-schema.org/draft-04/schema#",
     3    "id": "config_schema_v2.0.json",
     4    "type": "object",
     5  
     6    "properties": {
     7      "version": {
     8        "type": "string"
     9      },
    10  
    11      "services": {
    12        "id": "#/properties/services",
    13        "type": "object",
    14        "patternProperties": {
    15          "^[a-zA-Z0-9._-]+$": {
    16            "$ref": "#/definitions/service"
    17          }
    18        },
    19        "additionalProperties": false
    20      },
    21  
    22      "networks": {
    23        "id": "#/properties/networks",
    24        "type": "object",
    25        "patternProperties": {
    26          "^[a-zA-Z0-9._-]+$": {
    27            "$ref": "#/definitions/network"
    28          }
    29        }
    30      },
    31  
    32      "volumes": {
    33        "id": "#/properties/volumes",
    34        "type": "object",
    35        "patternProperties": {
    36          "^[a-zA-Z0-9._-]+$": {
    37            "$ref": "#/definitions/volume"
    38          }
    39        },
    40        "additionalProperties": false
    41      }
    42    },
    43  
    44    "additionalProperties": false,
    45  
    46    "definitions": {
    47  
    48      "service": {
    49        "id": "#/definitions/service",
    50        "type": "object",
    51  
    52        "properties": {
    53          "build": {
    54            "oneOf": [
    55              {"type": "string"},
    56              {
    57                "type": "object",
    58                "properties": {
    59                  "context": {"type": "string"},
    60                  "dockerfile": {"type": "string"},
    61                  "args": {"$ref": "#/definitions/list_or_dict"}
    62                },
    63                "additionalProperties": false
    64              }
    65            ]
    66          },
    67          "cap_add": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
    68          "cap_drop": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
    69          "cgroup_parent": {"type": "string"},
    70          "command": {
    71            "oneOf": [
    72              {"type": "string"},
    73              {"type": "array", "items": {"type": "string"}}
    74            ]
    75          },
    76          "container_name": {"type": "string"},
    77          "cpu_shares": {"type": ["number", "string"]},
    78          "cpu_quota": {"type": ["number", "string"]},
    79          "cpuset": {"type": "string"},
    80          "depends_on": {"$ref": "#/definitions/list_of_strings"},
    81          "devices": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
    82          "dns": {"$ref": "#/definitions/string_or_list"},
    83          "dns_search": {"$ref": "#/definitions/string_or_list"},
    84          "domainname": {"type": "string"},
    85          "entrypoint": {
    86            "oneOf": [
    87              {"type": "string"},
    88              {"type": "array", "items": {"type": "string"}}
    89            ]
    90          },
    91          "env_file": {"$ref": "#/definitions/string_or_list"},
    92          "environment": {"$ref": "#/definitions/list_or_dict"},
    93  
    94          "expose": {
    95            "type": "array",
    96            "items": {
    97              "type": ["string", "number"],
    98              "format": "expose"
    99            },
   100            "uniqueItems": true
   101          },
   102  
   103          "extends": {
   104            "oneOf": [
   105              {
   106                "type": "string"
   107              },
   108              {
   109                "type": "object",
   110  
   111                "properties": {
   112                  "service": {"type": "string"},
   113                  "file": {"type": "string"}
   114                },
   115                "required": ["service"],
   116                "additionalProperties": false
   117              }
   118            ]
   119          },
   120  
   121          "external_links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
   122          "extra_hosts": {"$ref": "#/definitions/list_or_dict"},
   123          "hostname": {"type": "string"},
   124          "image": {"type": "string"},
   125          "ipc": {"type": "string"},
   126          "labels": {"$ref": "#/definitions/list_or_dict"},
   127          "links": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
   128  
   129          "logging": {
   130              "type": "object",
   131  
   132              "properties": {
   133                  "driver": {"type": "string"},
   134                  "options": {"type": "object"}
   135              },
   136              "additionalProperties": false
   137          },
   138  
   139          "mac_address": {"type": "string"},
   140          "mem_limit": {"type": ["number", "string"]},
   141          "memswap_limit": {"type": ["number", "string"]},
   142          "network_mode": {"type": "string"},
   143  
   144          "networks": {
   145            "oneOf": [
   146              {"$ref": "#/definitions/list_of_strings"},
   147              {
   148                "type": "object",
   149                "patternProperties": {
   150                  "^[a-zA-Z0-9._-]+$": {
   151                    "oneOf": [
   152                      {
   153                        "type": "object",
   154                        "properties": {
   155                          "aliases": {"$ref": "#/definitions/list_of_strings"},
   156                          "ipv4_address": {"type": "string"},
   157                          "ipv6_address": {"type": "string"}
   158                        },
   159                        "additionalProperties": false
   160                      },
   161                      {"type": "null"}
   162                    ]
   163                  }
   164                },
   165                "additionalProperties": false
   166              }
   167            ]
   168          },
   169          "pid": {"type": ["string", "null"]},
   170  
   171          "ports": {
   172            "type": "array",
   173            "items": {
   174              "type": ["string", "number"],
   175              "format": "ports"
   176            },
   177            "uniqueItems": true
   178          },
   179  
   180          "privileged": {"type": "boolean"},
   181          "read_only": {"type": "boolean"},
   182          "restart": {"type": "string"},
   183          "security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
   184          "shm_size": {"type": ["number", "string"]},
   185          "stdin_open": {"type": "boolean"},
   186          "stop_signal": {"type": "string"},
   187          "tmpfs": {"$ref": "#/definitions/string_or_list"},
   188          "tty": {"type": "boolean"},
   189          "ulimits": {
   190            "type": "object",
   191            "patternProperties": {
   192              "^[a-z]+$": {
   193                "oneOf": [
   194                  {"type": "integer"},
   195                  {
   196                    "type":"object",
   197                    "properties": {
   198                      "hard": {"type": "integer"},
   199                      "soft": {"type": "integer"}
   200                    },
   201                    "required": ["soft", "hard"],
   202                    "additionalProperties": false
   203                  }
   204                ]
   205              }
   206            }
   207          },
   208          "user": {"type": "string"},
   209          "volumes": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
   210          "volume_driver": {"type": "string"},
   211          "volumes_from": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
   212          "working_dir": {"type": "string"}
   213        },
   214  
   215        "dependencies": {
   216          "memswap_limit": ["mem_limit"]
   217        },
   218        "additionalProperties": false
   219      },
   220  
   221      "network": {
   222        "id": "#/definitions/network",
   223        "type": "object",
   224        "properties": {
   225          "driver": {"type": "string"},
   226          "driver_opts": {
   227            "type": "object",
   228            "patternProperties": {
   229              "^.+$": {"type": ["string", "number"]}
   230            }
   231          },
   232          "ipam": {
   233              "type": "object",
   234              "properties": {
   235                  "driver": {"type": "string"},
   236                  "config": {
   237                      "type": "array"
   238                  }
   239              },
   240              "additionalProperties": false
   241          },
   242          "external": {
   243            "type": ["boolean", "object"],
   244            "properties": {
   245              "name": {"type": "string"}
   246            },
   247            "additionalProperties": false
   248          }
   249        },
   250        "additionalProperties": false
   251      },
   252  
   253      "volume": {
   254        "id": "#/definitions/volume",
   255        "type": ["object", "null"],
   256        "properties": {
   257          "driver": {"type": "string"},
   258          "driver_opts": {
   259            "type": "object",
   260            "patternProperties": {
   261              "^.+$": {"type": ["string", "number"]}
   262            }
   263          },
   264          "external": {
   265            "type": ["boolean", "object"],
   266            "properties": {
   267              "name": {"type": "string"}
   268            }
   269          },
   270          "additionalProperties": false
   271        },
   272        "additionalProperties": false
   273      },
   274  
   275      "string_or_list": {
   276        "oneOf": [
   277          {"type": "string"},
   278          {"$ref": "#/definitions/list_of_strings"}
   279        ]
   280      },
   281  
   282      "list_of_strings": {
   283        "type": "array",
   284        "items": {"type": "string"},
   285        "uniqueItems": true
   286      },
   287  
   288      "list_or_dict": {
   289        "oneOf": [
   290          {
   291            "type": "object",
   292            "patternProperties": {
   293              ".+": {
   294                "type": ["string", "number", "null"]
   295              }
   296            },
   297            "additionalProperties": false
   298          },
   299          {"type": "array", "items": {"type": "string"}, "uniqueItems": true}
   300        ]
   301      },
   302  
   303      "constraints": {
   304        "service": {
   305          "id": "#/definitions/constraints/service",
   306          "anyOf": [
   307            {"required": ["build"]},
   308            {"required": ["image"]}
   309          ],
   310          "properties": {
   311            "build": {
   312              "required": ["context"]
   313            }
   314          }
   315        }
   316      }
   317    }
   318  }