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