Skip to content

Commit

Permalink
introduce top-level name
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
  • Loading branch information
ndeloof committed Jan 22, 2022
1 parent c4bab26 commit 1f3ec13
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
7 changes: 6 additions & 1 deletion schema/compose-spec.json
Expand Up @@ -8,7 +8,12 @@
"properties": {
"version": {
"type": "string",
"description": "Version of the Compose specification used. Tools not implementing required version MUST reject the configuration file."
"description": "declared for backward compatibility, ignored."
},

"name": {
"type": "string",
"description": "define the Compose project name, until user defines one explicitly."
},

"services": {
Expand Down
8 changes: 8 additions & 0 deletions spec.md
Expand Up @@ -49,6 +49,8 @@ A **Project** is an individual deployment of an application specification on a p
resources together and isolate them from other applications or other installation of the same Compose specified application with distinct parameters. A Compose implementation creating resources on a platform MUST prefix resource names by project and
set the label `com.docker.compose.project`.

Project name can be set explicitely by top-level `name` attribute. Compose implementation MUST offer a way for user to set a custom project name and override this name, so that the same `compose.yaml` file can be deployed twice on the same infrastructure, without changes, by just passing a distinct name.

### Illustrative example

The following example illustrates Compose specification concepts with a concrete example application. The example is non-normative.
Expand Down Expand Up @@ -223,6 +225,12 @@ Compose implementations SHOULD validate whether they can fully parse the Compose
because the Compose file was written with fields defined by a newer version of the specification, Compose implementations
SHOULD warn the user. Compose implementations MAY offer options to ignore unknown fields (as defined by ["loose"](#Requirements-and-optional-attributes) mode).

## Name top-level element

Top-level `name` property is defined by the specification as project name to be used if user don't se one explicitly.
Compose implementations MUST offer a way for user to override this name, and SHOULD define a mechanism to compute a
default project name, to be used only if the top-level `name` element is not set.

## Services top-level element

A Service is an abstract definition of a computing resource within an application which can be scaled/replaced
Expand Down

0 comments on commit 1f3ec13

Please sign in to comment.