I've spent 13 hours to compose Laravel Sail and I hadn't able to install it on Windows 10 operating system. But later fortunately my collegaue found the solution when he also bumbed into this error message:
Unsupported operating system [MINGW64_NT-10.0-19042]. Laravel Sail supports macOS, Linux, and Windows (WSL2).
During the 13 hours:
- Firstly I installed the Docker Desktop to Windows what runs the Docker environment.
- Docker requires WSL-2 on Windows and it seemed to me also needs installed Linux operation system. That's why I did this whole process: https://learn.microsoft.com/en-us/windows/wsl/install and I installed Ubuntu 20.04 version.
- After the installation I copy my whole project into the folder of Linux user. Bud I coudn't do anything in it (for example pull or push to my git repository) because of authentication issues.
- To solve this problem I created a symlink between the project in Windows and Linux based on these two answers: https://stackoverflow.com/questions/52545505/how-to-synchronize-code-files-on-windows-with-wsl-linux/62715180#62715180, https://stackoverflow.com/questions/65227492/laravel-8-laravel-sail-for-dev-on-windows-10-is-slow-how-to-speed-up/65236920#65236920
- It didn't solve the problem that's why I deleted the
/vendor/
folder in my project and rancomposer udpate
based on this answer: https://stackoverflow.com/a/65513584/10473070 Also didn't work. - After I did all the next process without success: https://codeburst.io/how-to-use-laravel-sail-with-the-docker-desktop-wsl-2-backend-3768a126a85
- It was a side effect that the MySQL couldn't reach the remote database and when the Docker finally worked the process consume half of my available memory.
- My final try was to create an empty Laravel 8 project for testing with curl call by this documentation: https://laravel.com/docs/8.x/installation#getting-started-on-windows
- The result was failure. Finally I uninstalled Linux and Docker Desktop.
The solution and partial explanations are in my answer.