diff --git a/spec.md b/spec.md index b1719168..3cff453b 100644 --- a/spec.md +++ b/spec.md @@ -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