I am learning to use Docker and I am trying to create a new project with laravel. So I installed Ubuntu with WSL, then i run Ubuntu with wsl -d Ubuntu, everything worked fine but then, but when I typed the following command: curl -s https://laravel.build/example-app | bash, Powershell gave me this message: Docker is not running.
My problem is that I actually have Docker running.
Assumed you have no other WSL2 Distribution, the Ubuntu should already be the default WSL2 distribution, and the docker client should have been available inside the distro.
It takes a while after starting a distribution until the docker cli is usable.
Whenever docker ps works, your command should work as well.
Can you explain why it is working now, whether you had to change something or just wait longer?
It will help others that stumble across this topic, to not just see a problem and a conversation about it, but also find a solution or explanation about what made it finally work.
Sorry, of course. I think it had something to do with the integration enabled for the Ubuntu distribution. After you asked about the version I was using, I checked the Docker settings, went to resources, and made sure that the integration was enabled. It turned out that it was not enabled. So, after activating it.
I waited for a while and then I went back to PowerShell. I entered the Ubuntu environment and confirmed that the ‘docker ps’ command was functioning properly. It indeed worked without any issues. After that, I proceeded to type ‘curl -s https://laravel.build/P1 | bash’ and everything worked perfectly.
I apologize if the explanation is not very detailed. I am currently learning to use Docker…
Thank you for sharing. I am sure it will help others that are in the same situation.
Note: You can run wsl --list to see which distro is set as default Distro. Depending whether Ubuntu is marked as default distro, the checkbox to enable integration with the default distro would be sufficient, if Ubuntu is not the default distro, then setting the toggle-switch to on indeed is necessary.