Can’t install Laravel with Docker & Sail on Mac M1. Fails to install swoole package

  docker, laravel, swoole

Trying to setup a Laravel local dev environment on my Mac M1 using Docker.
I followed the instructions on Laravels installation page, running

curl -s "https://laravel.build/example-app" | bash

And then

./vendor/bin/sail up

Error log

Building laravel.test
[+] Building 2.6s (10/17)                                                                          
 => [internal] load build definition from Dockerfile                                          0.0s
 => => transferring dockerfile: 37B                                                           0.0s
 => [internal] load .dockerignore                                                             0.0s
 => => transferring context: 2B                                                               0.0s
 => [internal] load metadata for docker.io/library/ubuntu:20.04                               2.0s
 => [auth] library/ubuntu:pull token for registry-1.docker.io                                 0.0s
 => [internal] load build context                                                             0.0s
 => => transferring context: 99B                                                              0.0s
 => [ 1/12] FROM docker.io/library/ubuntu:[email protected]:3c9c713e0979e9bd6061ed52ac1e9e1f246c9  0.0s
 => CACHED [ 2/12] WORKDIR /var/www/html                                                      0.0s
 => CACHED [ 3/12] RUN ln -snf /usr/share/zoneinfo/UTC /etc/localtime && echo UTC > /etc/tim  0.0s
 => CACHED [ 4/12] RUN apt-get update     && apt-get install -y gnupg gosu curl ca-certifica  0.0s
 => ERROR [ 5/12] RUN pecl install swoole                                                     0.6s
------                                                                                             
 > [ 5/12] RUN pecl install swoole:                                                                
#9 0.530 No releases available for package "pecl.php.net/swoole"
#9 0.530 install failed
------
executor failed running [/bin/sh -c pecl install swoole]: exit code: 1
ERROR: Service 'laravel.test' failed to build

How can I solve this?

Source: Laravel

Leave a Reply