mirror of https://github.com/docker/docs.git
Update 15-profiles.md (#19400)
Replaced foo bar words to improve readability
This commit is contained in:
parent
ec779a59b2
commit
78925b2a84
|
@ -24,42 +24,45 @@ Compose returns an error.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
services:
|
services:
|
||||||
foo:
|
web:
|
||||||
image: foo
|
image: web_image
|
||||||
bar:
|
|
||||||
image: bar
|
test_lib:
|
||||||
|
image: test_lib_image
|
||||||
profiles:
|
profiles:
|
||||||
- test
|
- test
|
||||||
baz:
|
|
||||||
image: baz
|
coverage_lib:
|
||||||
|
image: coverage_lib_image
|
||||||
depends_on:
|
depends_on:
|
||||||
- bar
|
- test_lib
|
||||||
profiles:
|
profiles:
|
||||||
- test
|
- test
|
||||||
zot:
|
|
||||||
image: zot
|
debug_lib:
|
||||||
|
image: debug_lib_image
|
||||||
depends_on:
|
depends_on:
|
||||||
- bar
|
- test_lib
|
||||||
profiles:
|
profiles:
|
||||||
- debug
|
- debug
|
||||||
```
|
```
|
||||||
|
|
||||||
In the above example:
|
In the above example:
|
||||||
|
|
||||||
- If the Compose application model is parsed with no profile enabled, it only contains the `foo` service.
|
- If the Compose application model is parsed with no profile enabled, it only contains the `web` service.
|
||||||
- If the profile `test` is enabled, the model contains the services `bar` and `baz`, and service `foo`, which is always enabled.
|
- If the profile `test` is enabled, the model contains the services `test_lib` and `coverage_lib`, and service `web`, which is always enabled.
|
||||||
- If the profile `debug` is enabled, the model contains both `foo` and `zot` services, but not `bar` and `baz`,
|
- If the profile `debug` is enabled, the model contains both `web` and `debug_lib` services, but not `test_lib` and `coverage_lib`,
|
||||||
and as such the model is invalid regarding the `depends_on` constraint of `zot`.
|
and as such the model is invalid regarding the `depends_on` constraint of `debug_lib`.
|
||||||
- If the profiles `debug` and `test` are enabled, the model contains all services; `foo`, `bar`, `baz` and `zot`.
|
- If the profiles `debug` and `test` are enabled, the model contains all services; `web`, `test_lib`, `coverage_lib` and `debug_lib`.
|
||||||
- If Compose is executed with `bar` as the explicit service to run, `bar` and the `test` profile
|
- If Compose is executed with `test_lib` as the explicit service to run, `test_lib` and the `test` profile
|
||||||
are active even if `test` profile is not enabled.
|
are active even if `test` profile is not enabled.
|
||||||
- If Compose is executed with `baz` as the explicit service to run, the service `baz` and the
|
- If Compose is executed with `coverage_lib` as the explicit service to run, the service `coverage_lib` and the
|
||||||
profile `test` are active and `bar` is pulled in by the `depends_on` constraint.
|
profile `test` are active and `test_lib` is pulled in by the `depends_on` constraint.
|
||||||
- If Compose is executed with `zot` as the explicit service to run, again the model is
|
- If Compose is executed with `debug_lib` as the explicit service to run, again the model is
|
||||||
invalid regarding the `depends_on` constraint of `zot`, since `zot` and `bar` have no common `profiles`
|
invalid regarding the `depends_on` constraint of `debug_lib`, since `debug_lib` and `test_lib` have no common `profiles`
|
||||||
listed.
|
listed.
|
||||||
- If Compose is executed with `zot` as the explicit service to run and profile `test` is enabled,
|
- If Compose is executed with `debug_lib` as the explicit service to run and profile `test` is enabled,
|
||||||
profile `debug` is automatically enabled and service `bar` is pulled in as a dependency starting both
|
profile `debug` is automatically enabled and service `test_lib` is pulled in as a dependency starting both
|
||||||
services `zot` and `bar`.
|
services `debug_lib` and `test_lib`.
|
||||||
|
|
||||||
See how you can use `profiles` in [Docker Compose](../profiles.md).
|
See how you can use `profiles` in [Docker Compose](../profiles.md).
|
||||||
|
|
Loading…
Reference in New Issue