-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Specify optional override files #11949
Comments
I'm worried such a flag would be confusing with the merge ability offered by
Indeed, still such a change would have major impact for users who already have such an override but don't expect it to be selected. We can't adopt such an approach. The alternative you describe is a common pattern used by many compose users, relying on |
The Do I understand it correctly that you're worried users would accidentally type |
yes, won't be obvious how those two flags differ and I can guess some won't understand they can just repeat anyway, for your use-case the existing and common practice you already identified is to use per-environment folder with relevant files |
Ok, thanks for your time. If you believe it would cause problems it's probably not worth it. I'll probably rename and nest the files then. |
Description
Issues
Currently, when a file is not specified,
docker compose
picks upcompose.yml
and optionallycompose.override.yml
if it exists.I have a project with multiple compose files so each has specific name and I'd like to have an option to have override files for these but having
first-compose.yml
andfirst-compose.override.yml
, the second is not automatically used. If I pass both with the-f
option, the second must exist.Proposal
Add
--override-file
which would merge a file into the compose file if it exists and not produce an error if it doesn't. It would have to be specified after--file
has been specified and it would be merged along with other--file
options in the order it has been specified on the command line.Alternatively, I belive the
.override.yaml
files used to be picked up and it would be convenient ifdocker compose
just found<docker-compose-name>.override.yml
automatically.Alternatives
Use
first/compose.yml
andfirst/compose.override.yml
instead.The text was updated successfully, but these errors were encountered: