Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions compose/compose-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -1143,8 +1143,20 @@ string. In the example above, if `EXTERNAL_PORT` is not set, the value for the
port mapping is `:5000` (which is of course an invalid port mapping, and will
result in an error when attempting to create the container).

Both `$VARIABLE` and `${VARIABLE}` syntax are supported. Extended shell-style
features, such as `${VARIABLE-default}` and `${VARIABLE/foo/bar}`, are not
In the case of environment variables that are not set, it is also possible to

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider "you can" instead of "it is possible to".

define default values using one of the following syntax variants:


* To provide a default value that will be used if `VARIABLE` is either *unset* or *empty*:

`${VARIABLE:-default}`

* To provide a default value only if `VARIABLE` is *empty*:

`${VARIABLE-default}`

Both `$VARIABLE` and `${VARIABLE}` syntax are supported. Extended
shell-style features, such as `${VARIABLE/foo/bar}`, are not
supported.

You can use a `$$` (double-dollar sign) when your configuration needs a literal
Expand Down