mirror of https://github.com/docker/docs.git
Explains order of precedence between env-file and env (#2903)
Resolves #1312
This commit is contained in:
parent
9a45c062fa
commit
553db19401
|
@ -89,6 +89,19 @@ Values in the shell take precedence over those specified in the `.env` file. If
|
||||||
web:
|
web:
|
||||||
image: 'webapp:v2.0'
|
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
|
## Configuring Compose using environment variables
|
||||||
|
|
||||||
Several environment variables are available for you to configure the Docker Compose command-line behaviour. They begin with `COMPOSE_` or `DOCKER_`, and are documented in [CLI Environment Variables](reference/envvars.md).
|
Several environment variables are available for you to configure the Docker Compose command-line behaviour. They begin with `COMPOSE_` or `DOCKER_`, and are documented in [CLI Environment Variables](reference/envvars.md).
|
||||||
|
|
Loading…
Reference in New Issue