See https://github.com/moby/moby/issues/29133#issuecomment-309429376
https://docs.docker.com/compose/compose-file/#variable-substitution
We should either remove the reference to .env from this document or clarify that it's only a docker-compose feature.
@dnephin : or create feature parity by adding a parameter to docker stack create to specify an env file?
I understand docker stack to be a replacement to docker-compose, but it is not?
Thanks!
Even if we were to add .env file support I don't think it's correct to document it here. This file should be a reference for the format. At most we should link to another page.
I understand docker stack to be a replacement to docker-compose, but it is not?
Maybe eventually, but certainly not now. They support the same format (with a few exceptions) but the commands are designed for different use cases. docker-compose is designed for development and testing workflows, docker stack deploy is designed for more general use cases (including production). The trade offs are a bit different. One is not a drop-in replacement for the other.
ping @londoncalling
@dnephin I believe this is where docker-compose.yml syntax is documented, both for Compose (docker-compose) and for docker stack deploy. Throughout this page is documentation specifying which features and what syntax is available via either docker-compose or docker stack deploy. For the '.env' feature, one is simply led to conclude that it's available for both, and I'm of the opinion it should be.
New users first learn about docker-compose.yml (the file) when they experiment with docker-compose (the command).
Then they get into to swarm stuff, and it's still referred to as a docker-compose.yml file.
The documentation should maybe use a different name, like docker stack deploy -c docker-swarm.yml.
@dperetti this is a good idea to differentiate and clarify the Compose filename for new users. However, It will be a bit of work because there are a lot of moving parts (asciinema, screen snaps, example code, and possibly more ...)
Let's see if we can get @johndmulhausen, @mistyhacks, or @JimGalasyn to weigh in on it for bandwidth right now. What do you guys think?
Most helpful comment
New users first learn about docker-compose.yml (the file) when they experiment with docker-compose (the command).
Then they get into to swarm stuff, and it's still referred to as a docker-compose.yml file.
The documentation should maybe use a different name, like
docker stack deploy -c docker-swarm.yml.