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

Most upvoted comments

Yeah - I think we’ll have to bump to 21.10 - I’ll get it sorted out.

Still happening for me:

vendor/bin/sail up                                                                                                                                                                                ✭
[+] Running 0/1
 ⠿ laravel.test Error                                                                                                                                                                                                              0.2s
[+] Building 2.7s (8/15)                                                                                                                                                                                                                
 => [internal] load build definition from Dockerfile                                                                                                                                                                               0.0s
 => => transferring dockerfile: 32B                                                                                                                                                                                                0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                  0.0s
 => => transferring context: 2B                                                                                                                                                                                                    0.0s
 => [internal] load metadata for docker.io/library/ubuntu:21.10                                                                                                                                                                    0.5s
 => [ 1/11] FROM docker.io/library/ubuntu:21.10@sha256:ff46b78279f207db3b8e57e20dee7cecef3567d09489369d80591f150f9c8154                                                                                                            0.0s
 => [internal] load build context                                                                                                                                                                                                  0.0s
 => => transferring context: 99B                                                                                                                                                                                                   0.0s
 => CACHED [ 2/11] WORKDIR /var/www/html                                                                                                                                                                                           0.0s
 => CACHED [ 3/11] RUN ln -snf /usr/share/zoneinfo/UTC /etc/localtime && echo UTC > /etc/timezone                                                                                                                                  0.0s
 => ERROR [ 4/11] 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  2.2s
------                                                                                                                                                                                                                                  
 > [ 4/11] 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 hkps://keyserver.ubuntu.com --recv-keys 14AA40EC0831756756D7F66C4F4EA0AAE5267A6C     && echo "deb https://ppa.launchpadcontent.net/ondrej/php/ubuntu impish main" > /etc/apt/sources.list.d/ppa_ondrej_php.list     && apt-get update     && apt-get install -y php7.4-cli php7.4-dev        php7.4-pgsql php7.4-sqlite3 php7.4-gd        php7.4-curl php7.4-memcached        php7.4-imap php7.4-mysql php7.4-mbstring        php7.4-xml php7.4-zip php7.4-bcmath php7.4-soap        php7.4-intl php7.4-readline php7.4-pcov        php7.4-msgpack php7.4-igbinary php7.4-ldap        php7.4-redis php7.4-xdebug     && php -r "readfile('https://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer     && curl -sL https://deb.nodesource.com/setup_16.x | bash -     && apt-get install -y nodejs     && npm install -g npm     && 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/*:
#0 0.625 Ign:1 http://ports.ubuntu.com/ubuntu-ports impish InRelease
#0 0.787 Ign:2 http://ports.ubuntu.com/ubuntu-ports impish-updates InRelease
#0 0.942 Ign:3 http://ports.ubuntu.com/ubuntu-ports impish-backports InRelease
#0 1.107 Ign:4 http://ports.ubuntu.com/ubuntu-ports impish-security InRelease
#0 1.260 Err:5 http://ports.ubuntu.com/ubuntu-ports impish Release
#0 1.260   404  Not Found [IP: 185.125.190.39 80]
#0 1.408 Err:6 http://ports.ubuntu.com/ubuntu-ports impish-updates Release
#0 1.408   404  Not Found [IP: 185.125.190.39 80]
#0 1.971 Err:7 http://ports.ubuntu.com/ubuntu-ports impish-backports Release
#0 1.971   404  Not Found [IP: 185.125.190.39 80]
#0 2.115 Err:8 http://ports.ubuntu.com/ubuntu-ports impish-security Release
#0 2.115   404  Not Found [IP: 185.125.190.39 80]
#0 2.123 Reading package lists...
#0 2.139 E: The repository 'http://ports.ubuntu.com/ubuntu-ports impish Release' does not have a Release file.
#0 2.139 E: The repository 'http://ports.ubuntu.com/ubuntu-ports impish-updates Release' does not have a Release file.
#0 2.139 E: The repository 'http://ports.ubuntu.com/ubuntu-ports impish-backports Release' does not have a Release file.
#0 2.139 E: The repository 'http://ports.ubuntu.com/ubuntu-ports impish-security Release' does not have a Release file.
------
failed to solve: executor failed running [/bin/sh -c 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 hkps://keyserver.ubuntu.com --recv-keys 14AA40EC0831756756D7F66C4F4EA0AAE5267A6C     && echo "deb https://ppa.launchpadcontent.net/ondrej/php/ubuntu impish main" > /etc/apt/sources.list.d/ppa_ondrej_php.list     && apt-get update     && apt-get install -y php7.4-cli php7.4-dev        php7.4-pgsql php7.4-sqlite3 php7.4-gd        php7.4-curl php7.4-memcached        php7.4-imap php7.4-mysql php7.4-mbstring        php7.4-xml php7.4-zip php7.4-bcmath php7.4-soap        php7.4-intl php7.4-readline php7.4-pcov        php7.4-msgpack php7.4-igbinary php7.4-ldap        php7.4-redis php7.4-xdebug     && php -r "readfile('https://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer     && curl -sL https://deb.nodesource.com/setup_$NODE_VERSION.x | bash -     && apt-get install -y nodejs     && npm install -g npm     && 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/*]: exit code: 100

Yeah - I think we’ll have to bump to 21.10 - I’ll get it sorted out.

21.10 doesn’t seem to be solving it for me. Still getting Unable to locate [insert-every-extension-here]

don’t forget to update the repo to impish on line 22 as well:

check also. Was able to build the php8.0 image by making those two changes: Line 1: FROM ubuntu:21.10 Line 22: echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu impish main" > /etc/apt/sources.list.d/ppa_ondrej_php.list

sail build --no-cache
no such service: laravel.test
[+] Building 82.6s (17/17) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                                 0.0s
 => => transferring dockerfile: 2.42kB                                                                                                                               0.0s
 => [internal] load .dockerignore                                                                                                                                    0.0s
 => => transferring context: 2B                                                                                                                                      0.0s
 => [internal] load metadata for docker.io/library/ubuntu:21.10                                                                                                      0.6s
 => [ 1/12] FROM docker.io/library/ubuntu:21.10@sha256:1108598c6469492b0ec61c4c9bab6868a3d335ecf76deb4d31ff3b2615170ae9                                              0.0s
 => [internal] load build context                                                                                                                                    0.0s
 => => transferring context: 99B                                                                                                                                     0.0s
 => CACHED [ 2/12] WORKDIR /var/www/html                                                                                                                             0.0s
 => [ 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     && mk  76.2s
 => [ 5/12] RUN update-alternatives --set php /usr/bin/php8.0                                                                                                        0.2s
 => [ 6/12] RUN setcap "cap_net_bind_service=+ep" /usr/bin/php8.0                                                                                                    0.3s
 => [ 7/12] RUN groupadd --force -g 20 sail                                                                                                                          0.2s
 => [ 8/12] RUN useradd -ms /bin/bash --no-user-group -g 20 -u 1337 sail                                                                                             0.4s
 => [ 9/12] COPY start-container /usr/local/bin/start-container                                                                                                      0.0s
 => [10/12] COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf                                                                                            0.0s
 => [11/12] COPY php.ini /etc/php/8.0/cli/conf.d/99-sail.ini                                                                                                         0.0s
 => [12/12] RUN chmod +x /usr/local/bin/start-container                                                                                                              0.2s
 => exporting to image                                                                                                                                               4.1s
 => => exporting layers                                                                                                                                              4.1s
 => => writing image sha256:2690c640a54d1333856039403ee94b7a27471f6869a658047a283d466ef8283d                                                                         0.0s
 => => naming to sail-8.0/app                                                                                                                                        0.0s

Ubuntu 22.04 seems to work better, but it still crashes because php8.1-swoole is missing.

If everything else is working… Perfect, swoole can go awol

1.13.4 fixes this.

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.

Yeah - I think we’ll have to bump to 21.10 - I’ll get it sorted out.

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).

Yeah - I think we’ll have to bump to 21.10 - I’ll get it sorted out.

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 impish on line 22 as well:

&& echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu impish main" > /etc/apt/sources.list.d/ppa_ondrej_php.list \

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.