If you have run Docker Compose on Windows 10 and it has crashed with: failed to solve: rpc error: code = Unknown desc = error from sender: readdir: open c:\project The filename, directory name, or volume label syntax is incorrect.
Then you have come to the right place. The solution proposed is only one of the solutions available and is the one that has worked for me for most projects. It requires you to install WSL 2, a Linux Distribution image and to Docker integrations. Once this is done, you can open a Linux shell of your choice in Windows 10 and run docker compose up successfully.
So to summarize the steps are as follows:
- Install WSL 2
- Install a Linux Distribution of your choice e.g. Ubuntu 20.04
- Make sure Docker integration is set.
- Open Windows Terminal
- From Windows Terminal click the + sign and create a new Linux Shell for example: Ubuntu 20.04
- From there you should be able to run docker compose to completion
If you receive docker could not be found then check the post at: https://everythingtech.dev/2021/06/how-to-fix-docker-could-not-be-found-ubuntu-20-04-wsl-2-windows-10/
Hope this has helped you!