sail: Laravel Sail fails to build laravel.test service
- Sail Version: 1.8.2
- Laravel Version: 8.48.2
- PHP Version: 8.0.6
- OS: Windows running WSL2 Ubuntu 20.04
Description:
sail up fails building laravel.test service by this error:
Building laravel.test
[+] Building 217.8s (9/16)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 2.43kB 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/ubuntu:21.04 3.4s
=> [internal] load build context 0.0s
=> => transferring context: 906B 0.0s
=> [ 1/12] FROM docker.io/library/ubuntu:21.04@sha256:a30456233740024b9d297f5bcaa7439446a97bc59b25cadcdae829c334827945 3.8s
=> => resolve docker.io/library/ubuntu:21.04@sha256:a30456233740024b9d297f5bcaa7439446a97bc59b25cadcdae829c334827945 0.0s
=> => sha256:3e2d1c03542857d58a3cae774cad57f863543c683f444da46126220e343c359f 31.84MB / 31.84MB 1.6s
=> => sha256:a30456233740024b9d297f5bcaa7439446a97bc59b25cadcdae829c334827945 1.20kB / 1.20kB 0.0s
=> => sha256:13dc7df85a3315882644746ae501acdbf40e96d2f4c1df0032cc18f10a2e0c50 529B / 529B 0.0s
=> => sha256:093da574621da4e7c9f9560f7a929e3e8e26de6a15096630ec874669a5f89427 1.46kB / 1.46kB 0.0s
=> => extracting sha256:3e2d1c03542857d58a3cae774cad57f863543c683f444da46126220e343c359f 2.0s
=> [ 2/12] WORKDIR /var/www/html 0.1s
=> [ 3/12] RUN ln -snf /usr/share/zoneinfo/UTC /etc/localtime && echo UTC > /etc/timezone 0.3s
=> [ 4/12] RUN apt-get update && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 && mkdir -p ~/.gnupg && chmod 600 ~/.gnupg && echo "di 209.3s
=> ERROR [ 5/12] RUN pecl channel-update https://pecl.php.net/channel.xml && pecl install swoole && pecl clear-cache && rm -rf /tmp/* /var/tmp/* 0.5s
------
> [ 5/12] RUN pecl channel-update https://pecl.php.net/channel.xml && pecl install swoole && pecl clear-cache && rm -rf /tmp/* /var/tmp/*:
#8 0.465 PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported in /usr/share/php/PEAR/Config.php on line 2095
------
executor failed running [/bin/sh -c pecl channel-update https://pecl.php.net/channel.xml && pecl install swoole && pecl clear-cache && rm -rf /tmp/* /var/tmp/*]: exit code: 255
ERROR: Service 'laravel.test' failed to build : Build failed
Steps To Reproduce:
After installing Sail on the project and adding mariadb through php artisan sail:install you do sail up (with proper alias pointing to vendor/bin/sail)
Then docker starts building all docker-compose.yml services and stops because this line:
#8 0.465 PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported in /usr/share/php/PEAR/Config.php on line 2095
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 4
- Comments: 29 (6 by maintainers)
Distributor ID: Ubuntu Description: Ubuntu 20.04.3 LTS Release: 20.04 Codename: focal
Steps:
Error:
Solution:
This a Pear/PECL problem. The PEAR library included with the Ubuntu distribution is very old. To fix it, make sure you have the latest version.
Add this to the Dockerfile after the PHP block:
Just installed WSL2 and Docker, tried to create a new laravel sail project and got the same error. Don’t think it’s a problem with Docker containers/volumes because I did a clean install and still got the error
Run this: docker system prune --force. It will probably free up GBs of disk space.
Then make sure that you are installing the php-xml extension as well as the php8.0-xml extension whilst you’re at it.
It solved my build issues after Sail upgraded as part of the Laravel 9 upgrade.
Thanks! System prune helped!
Hi, I’ve been having a lot of problems with Laravel sail to run up my Laravel projects, some times I’d uninstall docker completely and reinstall it newly, but now I’ve removed the composer.lock and did run composer update after that I’d run sail up -d and I resolved.
I experienced this exact same issue on MacOS with 1.8.2, downgraded to 1.8.1 and containers built with no issues.