Repository navigation
feat(run): accept repeatable --compose-file to layer compose files - #48
Merged
Merged
Conversation
run's --compose-file now works like docker's own -f: pass it more than once and the files are set on COMPOSE_FILE in order, so a later file (a gitignored local override a developer layers on) wins over an earlier one. The generated secrets override is still appended last, so resolved secrets are never shadowed. Service-name scoping unions the services declared across every base file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
run points COMPOSE_FILE at the base compose file plus the secret override it regenerates, and it sets that variable itself. A side effect is that docker's own layering, whether the automatic docker-compose.override.yml or an inherited COMPOSE_FILE, is suppressed, so there was no first-class way to layer a local compose file over the base when running through ultra. Consumers were left shell-wrapping the exec'd command to re-append to COMPOSE_FILE, which is easy to get wrong and hides intent.
This makes --compose-file behave like docker's own -f: pass it more than once and the files are ordered on COMPOSE_FILE as given, so a later file wins over an earlier one. The common case is a developer keeping a gitignored override next to the base to tweak non-secret config for local dev. The generated secrets override stays last in the chain so resolved secrets are never shadowed by a layered file, and service-name scoping now unions the services across every base file so an app defined only in a later file still resolves.
Single --compose-file usage is unchanged, so this is backward compatible.