I suggest skipping docker and WSL, and simply use Laravel Herd instead for your development.
laravel 11 - install with docker
Following Laravel doc, I've installed Ubuntu 22.04 as a default distro for WSL2. Next, I've installed Docker Desktop and linked to WSL2. Next I open wsl terminal and typed as below, followed by my admin-psw . Then a list of files are displayed with: Permission denied attached, and the folder my-app doesn't exist. Stackoverflow suggest to edit the docker-file, but my folder doesn't exist so I don't know where is the docker-file [1]. Thanks.
I understood this could be a permission issue, but how do I fix it? Thanks
- Host: Win 10 22H2
- laravel 11
- WSL2 distro: Ubuntu 22.04
- Docker Desktop: 4.36
wsl terminal:
curl -s https://laravel.build/my-app | bash
output:
...
chown: changing ownership of './zipcontainer.dll': Permission denied
chown: changing ownership of './zipfldr.dll': Permission denied
chown: changing ownership of './ztrace_maps.dll': Permission denied
chown: changing ownership of './zu-ZA': Permission denied
chown: changing ownership of '.': Permission denied
Thank you! We hope you build something incredible. Dive in with: cd my-app && ./vendor/bin/sail up
[1] https://stackoverflow.com/questions/48619445/permission-denied-error-using-laravel-docker
Thanks Thrid, I managed to fix the issue, though I still don't know why. Here is what I did, in case anyone is falling in the same trap:
- I tried with Composer, but it failed because of conflicting versions (obviously). From wsl terminal:
$ sudo apt update
$ sudo apt install composer
$ sudo LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
$ sudo apt install php8.4-cli
$ sudo update-alternatives --set php /usr/bin/php8.4 ** set default php 8.4
$ composer create-project laravel/laravel laravel-sail
- Then, casually, I tried again with the original command, this time it worked:
$ curl -s https://laravel.build/myapp | bash
...
=> => exporting layers 14.5s
=> => writing image sha256:830c77e3039f83daf9f2a953533471ceeba9c179a49e71f3e09dff873c25df46 0.0s
=> => naming to sail-8.4/app 0.0s
=> [laravel.test] resolving provenance for metadata file 0.0s
Please provide your password so we can make some final adjustments to your application's permissions. ********
Thank you! We hope you build something incredible. Dive in with: cd myapp && ./vendor/bin/sail up
1st step is done, now I'll try building a small app and deploying it live.. Thanks everyone.
Please or to participate in this conversation.