-
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
Global service options #12382
Comments
Just use |
That's a confusing question. You don't add |
Yes indeed, I've been too fast posting an answer. Generally speaking, use of Compose doesn't offer any kind of "global/pattern override" that you could use to set attribute on all services. |
I understand, but at the moment the only way to reuse a configuration is to use yaml anchors or, as you suggested, with a variable. I think both solutions are bad and that is why I have marked this as a feature request. Explanation:
Assumption: there is currently no clean way to reuse/detail service configuration. |
variables is the way compose offers flexibility. The other way is by explicit override files |
Ok, I understand this would be a BIG change, but had to try 😀 I will stick to the variables for now, thanks. For me it can be closed, up to you. |
Description
Let's consider a project like this:
docker/additional-services.yml
- a file containing definitions of services that I don't want to know much aboutdocker-compose.yml
- a file containing core services of my projectdocker-compose.production.yml
- a file containing additional configuration for all services that should be applied in productionExample content of the files:
The issue is when I run
I would like to all the services being always restarted, but the only way of achieving this is running:
docker update --restart always $(docker ps -q)
It is not a clean solution, it would be better if I could
and this configuration would apply to the all services. There is a similar solution in the Gitlab CI configuration where
would print
1 + 1 = 2
forjob1
and2 + 2 = 4
forjob2
What could I do to make it clean?
The text was updated successfully, but these errors were encountered: