laraveldocker-composewindows-subsystem-for-linuxlaravel-sail

Laravel Sail command is very slow compared to docker compose


I'm using Laravel Sail on a WSL2 instance, on Windows 11 (Home). The project I'm working on is installed in the WSL filesystem, as I always do.

After executing any sail command, there's a delay of ~10 seconds before the command output is shown.

I've noticed that running the same commands directly with docker compose, has a little delay(~1.5sec), but nothing compared to sail.

Docker Compose

$ time docker compose exec laravel.test php artisan

docker-compose exec laravel.test php artisan  0.04s user 0.02s system 1% cpu 3.323 total

Sail

$ time sail artisan

sh $([ -f sail ] && echo sail || echo vendor/bin/sail) artisan  0.27s user 0.29s system 5% cpu 9.623 total

Ok, now that's weird! time reports that sail is executing the command in 0.27s, but as you can see from the following screen recording, that's not the case at all!

enter image description here

Please, if you know what can be the cause of this, let me know.

Thanks


Solution

  • It looks like the new version 4.39.0 fixed it. I just tested it, and it worked for me.
    https://docs.docker.com/desktop/release-notes/#4390

    Finally, a fix for this issue!