Docker Community Forums

Share and learn in the Docker community.

Support `env_file` equivalent in stack file

(Tai Lee) #1

Understandably, the stack file does not support env_file, because there is currently no way to create and distribute an env file across all the nodes a stack will be deployed to.

However, this is an important feature to avoid huge and repetitive stack files. One solution, which would be useful for compose files as well, would be to allow a top level environment section that applies to all services, or a subset of services.

This would only be possible in a v2 format of the stack file that is similar to v2 of the compose file, which I assume will happen at some point for other reasons.

Is this, or any other solution, in the pipeline for Docker Cloud?