-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add overwrite strategy options to config #3939
Conversation
Please sign your commits following these rules: $ git clone -b "override-strategy" [email protected]:CarstenHoyer/compose.git somewhere
$ cd somewhere
$ git commit --amend -s --no-edit
$ git push -f Ammending updates the existing PR. You DO NOT need to open a new one. |
9dc7a2f
to
f08bc08
Compare
It could be made simpler by just including the overwrite option and not the override_strategy option. I have prepared a branch for that: https://github.com/CarstenHoyer/compose/tree/overwrite |
f08bc08
to
856619c
Compare
1442404
to
c8a91c1
Compare
- Relates to docker#2260
1f55a60
to
2fadf2c
Compare
There hasn't been any activity on this in a while, is there any possibility this (or something similar) might make it in? |
+1 |
Any chance this one can get merged (pending the conflict resolution of course)?? This is quite useful for non-trivial multi-container apps. |
I haven´t gotten any feedback from Docker about this issue. I am ok rewriting it, if you think it should follow some different approach. But it would be nice to hear, if you think the idea in the feature, could be merged at some point. Thanks |
I would also love to have this option. |
Any news on this? |
I am afraid there was no progress - totally disappointing. Still have to use workarounds. |
Sooo looking forward for this feature. |
It's a shame that this has not been merged or resolved. |
This would be a helpful. |
Totally agree, this solves the |
Will this be merged any time soon? |
@docker there's clearly a community desire for this feature, it'd be nice to know one way or another if it or something similar might be added to docker-compose. |
it looks like docker-compose is abandoned. we should create a community fork. |
@CarstenHoyer Please write test. Thanks. |
Any updates? |
I am closing this pull request. I am not working with this anymore, so I can't keep it updated or write tests. Please reference this issue in a new request. |
Checkout how taurus does their config. Temped to repurpose their code into a docker compose wrapper |
I'm just going to experiment with generating |
Just wondering - why was this ignored by the docker team? No response or anything, is it just not useful and they disagree with it, no time? |
For now - without the ability to overwrite objects - we instead have to move the ports and other complex objects into yet another file, which we can cascade e.g.: # docker-compose.yml
...
some-svc:
image: xyz:${RELEASE:-latest}
... # docker-compose.prod.yml
...
some-svc:
env:
- "X=y"
... # docker-compose.local-ports.yml
...
some-svc:
ports:
- "3000:3000"
... # docker-compose.ci.yml
...
some-integration-test-svc:
...
... Generate a "production" (🤷) config to ship somewhere: COMPOSE_FILE="docker-compose.yml:docker-compose.prod.yml" docker-compose config > docker-compose.${RELEASE}.conf Run a composition for dev: COMPOSE_FILE="docker-compose.yml:docker-compose.ports.yml" docker-compose up Run a composition for some integration test: COMPOSE_FILE="docker-compose.yml:docker-compose.ports.yml:docker-compose.ci.yml" docker-compose up --build --abort-on-container-exit Not the end of the world, but a bit annoying. |
I wanted to remove I added this to a fish config file in my
Then, to use it: |
For those interested there is a simpler way to achieve this:
At this point when you run docke compose up you have the same container as you would configuring all in the docker-compose.yaml
To build the containers run docker compose -f docker-compose.yaml -f docker-compose.override.prod.yaml up Hope this helps! |
This PR introduces two new configuration options; override_strategy and overwrite.
override_strategy: Can be either 'default' or 'overwrite'. Default does nothing except being explicit. 'Overwrite' overwrites the base config with the override config.
overwrite: If override_strategy is set, this does not apply. Otherwise it will look at all the fields in the overwrite array and again overwrite the base config with the override config.
Overriding the set of values when extending the "ports" option. #2260 (comment)
Note there is currently no tests, I wanted to just see if there was any interest in this PR first.