Uh oh!
There was an error while loading. Please reload this page.
extends – Inherit services from other services - #1088
Conversation
bfirsh
commented
Mar 10, 2015
Nice! Looks great. |
bfirsh
commented
Mar 10, 2015
If we want a simpler example, we could have a I think there should be separate guides for setting up different environments with extends, and how to split up your configuration into multiple files. Perhaps the reference could just link off to those pages. |
There was a problem hiding this comment.
I'm not sure if the Here refers to the example above, or below - need a stronger way to delineate the 2 examples.
aanand
commented
Mar 12, 2015
Update: done a basic implementation. TODO in the description. |
aanand
commented
Mar 12, 2015
Also, this now sits atop #1099. |
funkyfuture
commented
Mar 12, 2015
the config-layout looks reasonable to me. still, i think it's important to clarify the possibilities what can be used in the |
dnephin
commented
Mar 13, 2015
It seems kind of arbitrary that I think this would be a lot more obvious to developers if it raised an error if the service you are trying to extend has any of these options, instead of copying over half the definition. A developer would still be able to have a similar setup, they'd just be forced to create some extra "base" services that exclude the links/net/volumes. |
aanand
commented
Mar 13, 2015
@dnephin I can see two sensible approaches with
Looking at it now, (1) seems better for multiple reasons:
|
aanand
commented
Mar 13, 2015
OK, I've blacklisted |
extendsextends – Inherit services from other servicesaanand
commented
Mar 13, 2015
extends – Inherit services from other servicesextends – Inherit services from other servicesbfirsh
commented
Mar 13, 2015
Looks great. Two things:
An aside: I'm not 100% convinced by having "base" services. I quite like the idea of having the default config inside the GitHub repo, then some downstream deployment system could overlay a production configuration on top without imposing that a base config exists. These are kinks we can smooth out over time though... |
dnephin
commented
Mar 13, 2015
@bfirsh that's fair. I think any time you try to "extend" a service definition that isn't in the current repo, it's more likely you actually want to pull in My understanding (based on #988) is that there will be support for doing this eventually, but we're addressing the easier case of "local includes" first (which is a bit of a different use case). It would be great to have a name to refer to these "external project includes". |
aanand
commented
Mar 18, 2015
Agreed - created #1127.
Circular import detection now pushed. |
aanand
commented
Mar 19, 2015
It was easier to implement #1109 on top of these changes, rather than independently, so I've done that. |
aanand
commented
Mar 19, 2015
This is ready to go, in my opinion. ping @dnephin |
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
aanand
commented
Mar 20, 2015
`extends` – Inherit services from other services
`extends` – Inherit services from other services Signed-off-by: Yuval Kohavi <yuval.kohavi@gmail.com>
iafilatov
commented
May 2, 2015
It's definitely good to be able to extend services defined elsewhere. One thing I don't understand is, why is it prohibited to extend services that have A simple project with an app and a db container. It should work anywhere there's Docker. If myimages is accessible, then Which obviously fails. Because app is linked to something (or gets volumes from somewhere...). The "solution" would be to pull The recommended approach seems to be to create base definitions for services and the write top-level ymls with I believe there should be no limitations as to which containers can be extended. Scalars should be overridden, lists should be merged. But besides that, it should be up to users how and what to extend. |
aanm
commented
May 2, 2015
@iafilatov See the #1380 it might fit what you want |
iafilatov
commented
May 2, 2015
Mostly yes, thanks. |
erichaus
commented
May 30, 2015
hello, how can I approach a case where I have multiple services which are each essentially isolated (microservice architecture w/REST communication between services), but I want a master compose repo/file that controls orchestrating/building the entire platform? Right now using the current extends syntax doesn't work bc the individual services all have their own links (databases/cache/etc) Any info appreciated, thanks! |
pikeas
commented
Jun 4, 2015
+1, I have a similar use case as @erichonkanen. Specifically, I have I would like to have a project-level (the directory above It seems reasonable to support links, in the following way: if you extend a service with links (or volumes_from), this should be allowed if and only you define a service of the same name (which can either also be an extension, or be created from scratch). |
vnwhlr
commented
Jun 25, 2015
+1’ing this, also, too. |
erichaus
commented
Jun 25, 2015
+1 |
…r#1088) Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.15.1 to 1.16.0. - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](prometheus/client_golang@v1.15.1...v1.16.0) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Here's a first pass at the feature also known as "import", "include" and "copy", most recently proposed in #988 and spiked out in #1080.
I feel like the example in the docs should be simpler. Perhaps there should be a new documentation page with a fuller explanation of the various intricacies (overriding individual env vars, 3-file example, not inheriting links or volumes_from), and a more concise explanation here.
Also, maybe
portsshould be included in the "not inherited" blacklist.TODO:
linksorvolumes_fromnet:container(waiting on Make volumes_from and net containers first class dependencies #1076)