github.com/olljanat/moby@v1.13.1/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              "type": ["string", "number"],
   171              "format": "ports"
   172            },
   173            "uniqueItems": true
   174          },
   175  
   176          "privileged": {"type": "boolean"},
   177          "read_only": {"type": "boolean"},
   178          "restart": {"type": "string"},
   179          "security_opt": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
   180          "shm_size": {"type": ["number", "string"]},
   181          "secrets": {
   182            "type": "array",
   183            "items": {
   184              "oneOf": [
   185                {"type": "string"},
   186                {
   187                  "type": "object",
   188                  "properties": {
   189                    "source": {"type": "string"},
   190                    "target": {"type": "string"},
   191                    "uid": {"type": "string"},
   192                    "gid": {"type": "string"},
   193                    "mode": {"type": "number"}
   194                  }
   195                }
   196              ]
   197            }
   198          },
   199          "sysctls": {"$ref": "#/definitions/list_or_dict"},
   200          "stdin_open": {"type": "boolean"},
   201          "stop_grace_period": {"type": "string", "format": "duration"},
   202          "stop_signal": {"type": "string"},
   203          "tmpfs": {"$ref": "#/definitions/string_or_list"},
   204          "tty": {"type": "boolean"},
   205          "ulimits": {
   206            "type": "object",
   207            "patternProperties": {
   208              "^[a-z]+$": {
   209                "oneOf": [
   210                  {"type": "integer"},
   211                  {
   212                    "type":"object",
   213                    "properties": {
   214                      "hard": {"type": "integer"},
   215                      "soft": {"type": "integer"}
   216                    },
   217                    "required": ["soft", "hard"],
   218                    "additionalProperties": false
   219                  }
   220                ]
   221              }
   222            }
   223          },
   224          "user": {"type": "string"},
   225          "userns_mode": {"type": "string"},
   226          "volumes": {"type": "array", "items": {"type": "string"}, "uniqueItems": true},
   227          "working_dir": {"type": "string"}
   228        },
   229        "additionalProperties": false
   230      },
   231  
   232      "healthcheck": {
   233        "id": "#/definitions/healthcheck",
   234        "type": "object",
   235        "additionalProperties": false,
   236        "properties": {
   237          "disable": {"type": "boolean"},
   238          "interval": {"type": "string"},
   239          "retries": {"type": "number"},
   240          "test": {
   241            "oneOf": [
   242              {"type": "string"},
   243              {"type": "array", "items": {"type": "string"}}
   244            ]
   245          },
   246          "timeout": {"type": "string"}
   247        }
   248      },
   249      "deployment": {
   250        "id": "#/definitions/deployment",
   251        "type": ["object", "null"],
   252        "properties": {
   253          "mode": {"type": "string"},
   254          "replicas": {"type": "integer"},
   255          "labels": {"$ref": "#/definitions/list_or_dict"},
   256          "update_config": {
   257            "type": "object",
   258            "properties": {
   259              "parallelism": {"type": "integer"},
   260              "delay": {"type": "string", "format": "duration"},
   261              "failure_action": {"type": "string"},
   262              "monitor": {"type": "string", "format": "duration"},
   263              "max_failure_ratio": {"type": "number"}
   264            },
   265            "additionalProperties": false
   266          },
   267          "resources": {
   268            "type": "object",
   269            "properties": {
   270              "limits": {"$ref": "#/definitions/resource"},
   271              "reservations": {"$ref": "#/definitions/resource"}
   272            }
   273          },
   274          "restart_policy": {
   275            "type": "object",
   276            "properties": {
   277              "condition": {"type": "string"},
   278              "delay": {"type": "string", "format": "duration"},
   279              "max_attempts": {"type": "integer"},
   280              "window": {"type": "string", "format": "duration"}
   281            },
   282            "additionalProperties": false
   283          },
   284          "placement": {
   285            "type": "object",
   286            "properties": {
   287              "constraints": {"type": "array", "items": {"type": "string"}}
   288            },
   289            "additionalProperties": false
   290          }
   291        },
   292        "additionalProperties": false
   293      },
   294  
   295      "resource": {
   296        "id": "#/definitions/resource",
   297        "type": "object",
   298        "properties": {
   299          "cpus": {"type": "string"},
   300          "memory": {"type": "string"}
   301        },
   302        "additionalProperties": false
   303      },
   304  
   305      "network": {
   306        "id": "#/definitions/network",
   307        "type": ["object", "null"],
   308        "properties": {
   309          "driver": {"type": "string"},
   310          "driver_opts": {
   311            "type": "object",
   312            "patternProperties": {
   313              "^.+$": {"type": ["string", "number"]}
   314            }
   315          },
   316          "ipam": {
   317            "type": "object",
   318            "properties": {
   319              "driver": {"type": "string"},
   320              "config": {
   321                "type": "array",
   322                "items": {
   323                  "type": "object",
   324                  "properties": {
   325                    "subnet": {"type": "string"}
   326                  },
   327                  "additionalProperties": false
   328                }
   329              }
   330            },
   331            "additionalProperties": false
   332          },
   333          "external": {
   334            "type": ["boolean", "object"],
   335            "properties": {
   336              "name": {"type": "string"}
   337            },
   338            "additionalProperties": false
   339          },
   340          "internal": {"type": "boolean"},
   341          "labels": {"$ref": "#/definitions/list_or_dict"}
   342        },
   343        "additionalProperties": false
   344      },
   345  
   346      "volume": {
   347        "id": "#/definitions/volume",
   348        "type": ["object", "null"],
   349        "properties": {
   350          "driver": {"type": "string"},
   351          "driver_opts": {
   352            "type": "object",
   353            "patternProperties": {
   354              "^.+$": {"type": ["string", "number"]}
   355            }
   356          },
   357          "external": {
   358            "type": ["boolean", "object"],
   359            "properties": {
   360              "name": {"type": "string"}
   361            },
   362            "additionalProperties": false
   363          },
   364          "labels": {"$ref": "#/definitions/list_or_dict"}
   365        },
   366        "additionalProperties": false
   367      },
   368  
   369      "secret": {
   370        "id": "#/definitions/secret",
   371        "type": "object",
   372        "properties": {
   373          "file": {"type": "string"},
   374          "external": {
   375            "type": ["boolean", "object"],
   376            "properties": {
   377              "name": {"type": "string"}
   378            }
   379          },
   380          "labels": {"$ref": "#/definitions/list_or_dict"}
   381        },
   382        "additionalProperties": false
   383      },
   384  
   385      "string_or_list": {
   386        "oneOf": [
   387          {"type": "string"},
   388          {"$ref": "#/definitions/list_of_strings"}
   389        ]
   390      },
   391  
   392      "list_of_strings": {
   393        "type": "array",
   394        "items": {"type": "string"},
   395        "uniqueItems": true
   396      },
   397  
   398      "list_or_dict": {
   399        "oneOf": [
   400          {
   401            "type": "object",
   402            "patternProperties": {
   403              ".+": {
   404                "type": ["string", "number", "null"]
   405              }
   406            },
   407            "additionalProperties": false
   408          },
   409          {"type": "array", "items": {"type": "string"}, "uniqueItems": true}
   410        ]
   411      },
   412  
   413      "constraints": {
   414        "service": {
   415          "id": "#/definitions/constraints/service",
   416          "anyOf": [
   417            {"required": ["build"]},
   418            {"required": ["image"]}
   419          ],
   420          "properties": {
   421            "build": {
   422              "required": ["context"]
   423            }
   424          }
   425        }
   426      }
   427    }
   428  }