Explains order of precedence between env-file and env (#2903)

Resolves #1312
This commit is contained in:
Suraj Narwade 2017-04-21 01:59:00 +05:30 committed by Misty Stanley-Jones
parent 9a45c062fa
commit 553db19401
1 changed files with 13 additions and 0 deletions

View File

@ -88,6 +88,19 @@ Values in the shell take precedence over those specified in the `.env` file. If
services:
web:
image: 'webapp:v2.0'
When values are provided with both with shell `environment` variable and with an `env_file` configuration file, values of environment variables will be taken from environment file first and then from environment key:
$ cat docker-compose.yml
version: '2.0'
services:
web:
image: 'webapp:v1.5'
env_file:
- ./test
environment:
- var=1
## Configuring Compose using environment variables