Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Add override option to service configuration for ports #6213
This adds the ability to explicitly override the ports configuration with a given docker-compose.override.yml. This is manly an updated version of this PR: #3939
We have a
This is bad in some cases: What if the base file contains a port binding which we want to change? This is currently not possible.
Inspired by @CarstenHoyer, I used his idea to add a new field to the service configuration called
Before this PR the result would be:
with this PR the result will be:
Signed-off-by: Johan M. von Behren firstname.lastname@example.org
As a side note, "ports" is an interesting case. I don't think
has any utility anyway (even if it does have a logical meaning). After the first
It is probably too late to revisit the
could be overridden with
Not sure how to go about deleting a port mapping. Perhaps
Thanks @jovobe for picking up and updating the previous PR.
My issue with this and the previous proposals is that I find the design extremely confusing and UX extremely poor (same for #5354). If we're going ahead with such a significant change, I want us to get it right, and I don't think we've found the right answer yet.
If you're invested in getting this resolved, would you be willing to create an issue dedicated to discussing the design for this feature? I'd start with an RFE to formalize what we're trying to achieve, and then we can start brainstorming what that looks like concretely in a Compose definition.
I agree, and still think the solution is to move away from an array and towards a dict, which provides the end user with all possible override possibilities (without requiring an