Merge pull request #2204 from mnowster/2123-escaping-env-variables

Attempt to document escaping env vars
This commit is contained in:
Daniel Nephin 2015-10-16 15:51:58 -04:00
commit ae3c66baed
1 changed files with 11 additions and 2 deletions

View File

@ -428,9 +428,18 @@ Both `$VARIABLE` and `${VARIABLE}` syntax are supported. Extended shell-style
features, such as `${VARIABLE-default}` and `${VARIABLE/foo/bar}`, are not features, such as `${VARIABLE-default}` and `${VARIABLE/foo/bar}`, are not
supported. supported.
If you need to put a literal dollar sign in a configuration value, use a double You can use a `$$` (double-dollar sign) when your configuration needs a literal
dollar sign (`$$`). dollar sign. This also prevents Compose from interpolating a value, so a `$$`
allows you to refer to environment variables that you don't want processed by
Compose.
web:
build: .
command: "$$VAR_NOT_INTERPOLATED_BY_COMPOSE"
If you forget and use a single dollar sign (`$`), Compose interprets the value as an environment variable and will warn you:
The VAR_NOT_INTERPOLATED_BY_COMPOSE is not set. Substituting an empty string.
## Compose documentation ## Compose documentation