sail: Sail build fails on clean installation
- Sail Version: 1.13.3
- Laravel Version: 9.1.0
- PHP Version: 8.1.1 (local but that really doesn’t affect the installation/build process)
- OS: macOS 12.2
- Docker Desktop: 4.5.0 (74594)
Description:
On a new Laravel installation the main (Laravel.test) image fails to build
Steps To Reproduce:
curl -s https://laravel.build/example-app | bash cd example-app ./vendor/bin/sail up
Following errors appears during the build process:
#8 19.75 E: Unable to locate package php8.1-cli #8 19.75 E: Couldn't find any package by glob 'php8.1-cli' #8 19.75 E: Couldn't find any package by regex 'php8.1-cli' #8 19.75 E: Unable to locate package php8.1-dev …
Basically all php8.1 components are failing to download/install
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 3
- Comments: 25 (2 by maintainers)
Commits related to this issue
- update dockerfiles to use 21.10 See: https://github.com/laravel/sail/issues/341 — committed to UMN-LATIS/Camino by jxjj 2 years ago
Yeah - I think we’ll have to bump to 21.10 - I’ll get it sorted out.
Still happening for me:
check also. Was able to build the php8.0 image by making those two changes: Line 1:
FROM ubuntu:21.10Line 22:echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu impish main" > /etc/apt/sources.list.d/ppa_ondrej_php.listIf everything else is working… Perfect, swoole can go awol
Just got a new project scaffolded on WSL2, thanks @taylorotwell!
Bumping the ubuntu image from 21.04 to 21.10 did it for me.
I see it here too - no idea how to fix though. If someone else knows let me know.
Ubuntu 22.04 seems to work better, but it still crashes because php8.1-swoole is missing.
1.13.4 fixes this.
Thanks, Taylor!
Ubuntu 22.04 also helped for me (and it flies on my M1 because there is a native arm build) but had to remove swoole, node and npm: `FROM ubuntu:22.04
LABEL maintainer=“Taylor Otwell”
ARG WWWGROUP
WORKDIR /var/www/html
ENV DEBIAN_FRONTEND noninteractive ENV TZ=UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
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 “disable-ipv6” >> ~/.gnupg/dirmngr.conf
&& apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys E5267A6C
&& apt-key adv --homedir ~/.gnupg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C300EE8C
&& echo “deb http://ppa.launchpad.net/ondrej/php/ubuntu hirsute main” > /etc/apt/sources.list.d/ppa_ondrej_php.list
&& apt-get update
&& apt-get install -y php8.1-cli php8.1-dev
php8.1-pgsql php8.1-sqlite3 php8.1-gd
php8.1-curl
php8.1-imap php8.1-mysql php8.1-mbstring
php8.1-xml php8.1-zip php8.1-bcmath php8.1-soap
php8.1-intl php8.1-readline
php8.1-ldap
php8.1-msgpack php8.1-igbinary php8.1-redis
php8.1-memcached php8.1-pcov php8.1-xdebug
&& php -r “readfile(‘https://getcomposer.org/installer’);” | php – --install-dir=/usr/bin/ --filename=composer
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
&& echo “deb https://dl.yarnpkg.com/debian/ stable main” > /etc/apt/sources.list.d/yarn.list
&& apt-get update
&& apt-get install -y yarn
&& apt-get install -y mysql-client
&& apt-get install -y postgresql-client
&& apt-get -y autoremove
&& apt-get clean
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN setcap “cap_net_bind_service=+ep” /usr/bin/php8.1
RUN groupadd --force -g $WWWGROUP sail RUN useradd -ms /bin/bash --no-user-group -g $WWWGROUP -u 1337 sail
COPY start-container /usr/local/bin/start-container COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf COPY php.ini /etc/php/8.1/cli/conf.d/99-sail.ini RUN chmod +x /usr/local/bin/start-container
EXPOSE 8000
ENTRYPOINT [“start-container”] `
For people using sail with php 8.0:
I added line 45/46 RUN update-alternatives --set php /usr/bin/php8.0 for forcing php 8.0 as cli, because there are 2 last versions of PHP installed (8.1 with basic modules, and 8.0 with all modules present in Dockerfile).
21.10 doesn’t seem to be solving it for me. Still getting
Unable to locate [insert-every-extension-here]Nice find, that’s likely it.
For anyone in a hurry to get this working, bumping the version in the Dockerfile to 20.10 worked but don’t forget to update the repo to
impishon line 22 as well:Could this be because Sail is still using Ubuntu 21.04 (Hirsute Hippo) which is no longer supported? It appears that the hirsute packages (that the Dockerfile is looking for) no longer exist on the ppa:ondrej/php repository.