This is definitely a new item: Sail now is failing from get go.
Steps to reproduce:
Ubuntu 20 on WSL2, Docker Desktop 4.1.1
in WSL2:
cd ~
curl -s https://laravel.build/example-app | bash
installation is complete
.. enter sudo password, then
cd example-app
./vendor/bin/sail up
results in
The "laravel.test" service is not running. Ensure the $APP_SERVICE environment variable exists and corresponds to a named, running service in your docker-compose.yml file.
Adjacent sail projects start and end without a problem
If you renamed your service from default name "laravel.test in the docker-compose.yml file then you need to add/rename the APP_SERVICE value in the .env file to the new name of the service.
For anyone coming across this later...
This also happens if you build your docker images under Windows (sail up) and then try to run them again under WSL. Rebuilding them fixes the issue.
@Nilpo Could you elaborate on what you mean? I have spent 3 weeks troubleshooting this on Windows and just discovered this post. I don't quite understand how it could be built in Windows and then again in WSL. I mean, I understand I could run a command in, say, Powershell, and then again in WSL in the same directory, but I am strictly in WSL and strictly run sail build / up. Although, I am navigated to the C drive when I run those commands.
Also, I switched to my Mac and ran these commands and end up with the same error.
To whom it may concern... Laravel 11 Sail, Ubuntu 22 PHP 8.4:
By changing the name of the laravel container (docker-compose.yml), e.g. laravel.test to laravel-inertia-app, when you run ./vendor/bin/sail artisan or any other command, it throws laravel.test is not running.
Fixed by adding to the .env file the environment variable with the new name of the service from docker-compose.yml APP_SERVICE=laravel-inertia-app.