Compose support in WSLc
Is your feature request related to a problem? Please describe.
I want wslc to be able to run compose scenarios.
Describe the solution you'd like
Some form of wslc compose should be supported.
Describe alternatives you've considered None.
Additional context N/A
Logs are required for review from WSL team
If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise, please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.
How to collect WSL logs
Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1
The script will output the path of the log file once done.
If this is a networking issue, please use .\collect-wsl-logs.ps1 -LogProfile networking instead, following the instructions in Collect WSL logs for networking issues
Once completed please upload the output files to this GitHub issue.
See Collect WSL logs (recommended method).
If you choose to email these logs instead of attaching them to the bug, please send them to [email protected] with the GitHub issue number in the subject, and include a link to your GitHub issue comment in the message body, and reply with '/emailed-logs'.
It’s interesting that a msft wsl pm is actually posting feature requests here. What’s even funnier is the bot's reply.
Indeed - glad to see that this is taking such a quick notice. Really looking forward to this implementation!
Now I wonder if there will be any type of constraints with containers that require a specific filesystem model or anything of the sort (e.g. projects that involve PostgreSQL dbs are ones that come to mind)
This is my number 1 use of containers. Either through Portainer, Docker, podman, what have you.. compose support is a must (and make sure it supports compose v3)
and wow there's already a PR https://github.com/clystian/WSL/pull/1
@dolorain I work directly on the team! We know people would want this so we made an issue to track it :)
I think the best approach would be for the WSLc Compose API to closely mirror the Docker Compose API 1:1, so it could act as a true drop-in replacement with full compatibility. This would make migration seamless for users, reduce the learning curve, and allow existing Compose files and tooling to work without any modifications, while still leaving room for WSLc-specific extensions where necessary.
The Compose Spec is very well documented, and would be a real boon to have built into wslc.
https://github.com/compose-spec/compose-spec/blob/main/spec.md
I frequently use docker-compose to orchestrate my app stacks. I would truly appreciate it if wslc adds support for compose in the future. It would be a game-changer for my development workflow!
it would be absolutely amazing to have it !
Looking forward to seeing this feature updated soon.
I was hoping for a docker-compose-like feature—glad to see someone else has already said this.
I can't wait for it to arrive at wslc
Just want to add my support for this. Compose is really useful in devcontainer setups, especially when you need to spin up multiple dependent containers (databases, message brokers, etc.), so I’d love to see this land in wslc. Thanks for all the great work!
Compose is really useful in devcontainer setups, especially when you need to spin up multiple dependent containers
Same here. Many of my dev-container setups require compose just for this.
I've built a lot of "compose like" systems and I'll tell you the best solution is to just use real compose and just expose the docker socket API. I've watched podman go through this and the effort to create a system that looks like docker but isn't docker is just not worth it. You end up creating an island like podman. Now a Microsoft island would of course be big, but your kind of lying to yourself that's that's the best solution, because it's a windows only island.
As I understand the official docker-compose binary uses the Docker API to work. If it is the case I recommend creating a http docker api compatible and then simply use the official docker-compose binary. Instead of implementing everything from scratch.
While it might not be 100% compatible with docker compose, podman compose has been great for simple scenarios, so while not perfect its better than no compose compatibility at all.
Fair points. I'd also be careful about a full reimplementation or a fork at this point.
For now, the most efficient path seems to be: make wslc expose a Docker API-compatible endpoint, and bundle upstream Compose as-is (Apache 2.0 allows it).
And I do think bundling matters. An out-of-the-box wslc compose is worth having, just backed by upstream rather than a rewrite.
A reimplementation can wait until bundling turns out to be impractical for some reason.
I absolutely agree with the approach to catch-up the 100% functionality by bundling, rather than starting from scratch to repeat that 100%. Anything beyond could be revisited, contributed, forked, or replaced later.
if i can help: https://github.com/bacarndiaye/wslc-compose