Skip to content

Commit 156485b

Browse files
committed
info on extends
1 parent e03fb7f commit 156485b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

content/reference/compose-file/services.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -773,11 +773,9 @@ extends:
773773

774774
#### Restrictions
775775

776-
When a service uses `extends`, it can also specify dependencies on other resources, an explicit `volumes` declaration for instance. However, it's important to note that `extends` does not automatically incorporate the target volume definition into the extending Compose file. Instead, you are responsible for ensuring that an equivalent resource exists for the service being extended to maintain consistency. Docker Compose verifies that a resource with the referenced ID is present within the Compose model.
776+
When a service is referenced using `extends`, it can declare dependencies on other resources. These dependencies may be explicitly defined through attributes like `volumes`, `networks`, `configs`, `secrets`, `links`, `volumes_from`, or `depends_on`. Alternatively, dependencies can reference another service using the `service:{name}` syntax in namespace declarations such as `ipc`, `pid`, or `network_mode`.
777777

778-
Dependencies on other resources in an `extends` target can be:
779-
- An explicit reference by `volumes`, `networks`, `configs`, `secrets`, `links`, `volumes_from` or `depends_on`
780-
- A reference to another service using the `service:{name}` syntax in namespace declaration (`ipc`, `pid`, `network_mode`)
778+
Compose does not automatically import these referenced resources into the extended model. It is your responsibility to ensure all required resources are explicitly declared in the model that relies on extends.
781779

782780
Circular references with `extends` are not supported, Compose returns an error when one is detected.
783781

0 commit comments

Comments
 (0)