Skip to content
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

Improve support for newer Docker Compose and environment variable substitution with Swarm #133

Closed
robertbartel opened this issue Feb 7, 2022 · 3 comments
Assignees
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request maas MaaS Workstream

Comments

@robertbartel
Copy link
Contributor

As documented here, the docker stack command doesn't support environmental variable substitution in the same way that docker-compose does. To work around this, DMOD has generated temporary config yaml files by preprocessing them using docker-compose config. This outputs the contents of a valid Compose file supplied to it, either as the implied default or explicitly using the -f flag, after performing variable substitution.

However, as of Compose versions >= 2.x, this won't work. Once adhering to the Compose V2 spec, the docker-compose config command omits the version element, leading to problems with Swarm interpreting the version of the Compose file specification being used.

It is possible (at least for now) to control whether to "Use Docker Compose V2" in the General section of Docker Desktop settings. But this may not always be a sufficient workaround, and a better solution could become necessary before a complete fix is supplied on the Docker side.

@robertbartel robertbartel added enhancement New feature or request dependencies Pull requests that update a dependency file maas MaaS Workstream labels Feb 7, 2022
@robertbartel robertbartel added this to the FY2022 (with NWM MVP) milestone Feb 7, 2022
@robertbartel
Copy link
Contributor Author

As noted here, among other places, we seem to have until next month to address this, so we are going to need to prioritize it.

@robertbartel robertbartel self-assigned this May 9, 2023
@aaraney
Copy link
Member

aaraney commented May 16, 2023

This will need to be tested, but https://github.com/aaraney/deployx should solve this issue.

@robertbartel
Copy link
Contributor Author

With the merge of #334, this can now be closed.

As a note for the record, it won't hurt to occassionally check in on this Moby issue on the lack of direct .env file support by docker stack, and this Docker CLI issue on docker stack properly adopting the compose spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement New feature or request maas MaaS Workstream
Projects
None yet
Development

No branches or pull requests

2 participants