Skip to content

Commit

Permalink
document use of COMPOSE_PROJECT_NAME as env variable
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 Nov 20, 2021
1 parent 5ac6ea5 commit bb155bb
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions spec.md
Expand Up @@ -227,9 +227,21 @@ SHOULD warn the user. Compose implementations MAY offer options to ignore unknow

## 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.
Top-level `name` property is defined by the specification as project name to be used if user doesn't set 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.
default project name, to be used if the top-level `name` element is not set.

Whenever project name is defined by top-level `name` or by some custom mechanism, it MUST be exposed for
[interpolation](#Interpolation) and environment variable resolution as `COMPOSE_PROJECT_NAME`

```yml
services:
foo:
image: busybox
environment:
- COMPOSE_PROJECT_NAME
command: echo "I'm running ${COMPOSE_PROJECT_NAME}"
```

## Services top-level element

Expand Down

0 comments on commit bb155bb

Please sign in to comment.