Explain how `volumes` and `devices` are merged (#5852)

This commit is contained in:
Christian Klaussner 2018-01-30 00:45:25 +01:00 committed by Misty Stanley-Jones
parent ab581979f8
commit f769463646
1 changed files with 22 additions and 2 deletions

View File

@ -326,8 +326,10 @@ For the **multi-value options** `ports`, `expose`, `external_links`, `dns`,
- "4000"
- "5000"
In the case of `environment`, `labels`, `volumes` and `devices`, Compose
"merges" entries together with locally-defined values taking precedence:
In the case of `environment`, `labels`, `volumes`, and `devices`, Compose
"merges" entries together with locally-defined values taking precedence. For
`environment` and `labels`, the environment variable or label name determines
which value is used:
# original service
environment:
@ -345,6 +347,24 @@ In the case of `environment`, `labels`, `volumes` and `devices`, Compose
- BAR=local
- BAZ=local
Entries for `volumes` and `devices` are merged using the mount path in the
container:
# original service
volumes:
- ./original:/foo
- ./original:/bar
# local service
volumes:
- ./local:/bar
- ./local:/baz
# result
volumes:
- ./original:/foo
- ./local:/bar
- ./local:/baz