laravel / sail

Docker files for running a basic Laravel application.
https://laravel.com/docs/sail
MIT License
1.68k stars 476 forks source link

failed to solve: dockerfile parse error on line 36: unknown instruction: && #720

Closed SergioTGSerra closed 2 months ago

SergioTGSerra commented 2 months ago

Sail Version

1.31.2

Laravel Version

11.1.5

PHP Version

8.3

Operating System

Windows (WSL)

OS Version

11

Description

Laravel Sail, WSL - Ubuntu 22.04.3 LTS

ERROR:

[+] Building 0.1s (1/1) FINISHED                                                                         docker:default
 => [laravel.test internal] load build definition from Dockerfile                                                  0.0s
 => => transferring dockerfile: 3.39kB                                                                             0.0s
failed to solve: dockerfile parse error on line 36: unknown instruction: &&

Please provide your password so we can make some final adjustments to your application's permissions.

[sudo] password for serra:

Thank you! We hope you build something incredible. Dive in with: cd VMHM && ./vendor/bin/sail up
serra@DESKTOP-UUD2EGE:~$ cd VMHM && ./vendor/bin/sail up
[+] Running 1/1
 ! laravel.test Warning Get "https://sail-8.3/v2/": dialing sail-8.3:443 container via di...                      10.2s
[+] Building 0.1s (1/1) FINISHED                                                                         docker:default
 => [laravel.test internal] load build definition from Dockerfile                                                  0.0s
 => => transferring dockerfile: 3.39kB                                                                             0.0s
failed to solve: dockerfile parse error on line 36: unknown instruction: &&
serra@DESKTOP-UUD2EGE:~/VMHM$

Steps To Reproduce

curl -s "https://laravel.build/VMHM?with=mysql" | bash
cd VMHM && ./vendor/bin/sail up

I think it's not possible to create new laravel projects with sail. I've already tested this machine with Windows 11 and on a machine with Ubuntu Desktop 24.04.1 LTS and it doesn't work either.

airdev-web commented 2 months ago

Had the same issue,

Manually updated the vendor/laravel/sail/runtimes/8.3/Dockerfile to add a "\" at the end of the line

...
       php8.3-memcached php8.3-pcov php8.3-imagick php8.3-xdebug \
       && pecl install swoole-5.1.2 \
       && echo "extension=swoole.so" > /etc/php/8.3/cli/conf.d/20-swoole.ini \ <--- Added this "\" there
&& curl -sLS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/ --filename=composer \
...

But I think they have to update it the repo?

driesvints commented 2 months ago

fixed