ENGDOCS-1965 (#19236)

* ENGDOCS-1965

* Update content/compose/compose-file/13-merge.md

Co-authored-by: Stephanie Aurelio <133041642+stephaurelio@users.noreply.github.com>

---------

Co-authored-by: Stephanie Aurelio <133041642+stephaurelio@users.noreply.github.com>
This commit is contained in:
Allie Sadler 2024-01-29 11:34:39 +00:00 committed by GitHub
parent f94771e77f
commit 7d55c16d5a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 25 additions and 1 deletions

View File

@ -180,4 +180,28 @@ services:
read_only: false
environment: {}
ports: []
```
```
### Replace value
While `!reset` can be used to remove a declaration from a Compose file using an override file, `!override` allows you
to fully replace an attribute, bypassing the standard merge rules. A typical example is to fully replace a resource definition, to rely on a distinct model but using the same name.
Merging the following example YAML trees:
```yaml
networks:
foo:
# this is production configuration
name: production-overlay-network
driver: overlay
driver-opts: (...)
```
```yaml
networks:
# this is development configuration
foo: !override {}
```
Results in a Compose application model equivalent to the override YAML tree.