Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix php8.0-dev depending on php8.1-cli #316

Merged
merged 2 commits into from
Jan 20, 2022

Conversation

mist-01
Copy link
Contributor

@mist-01 mist-01 commented Jan 19, 2022

Fixes #314
As described in #314, the php8.0 runtime installs packages which recommend php-pear which depends on the most recent version of php (8.1). The results in php8.1 getting installed as the default runtime. The PR suggest adding –no-install-recommends to the apt-get command in the Dockerfile to prevent the recommendations from being installed.

I tried this change out and it did prevent php8.1 from being installed. However, it does mean that php-pear (and any other recommends) are not installed. As far as I am aware, sail does not depend on php-pear and the container seems to run fine without it (default Laravel page opens in the browser).

We could also fix this by running an apt-get remove php8.1-cli in the dockerfile after line 31 if we would rather leave recommended packages installed. Thoughts?

@hluaces
Copy link

hluaces commented Jan 19, 2022

This fixed the issue for me.

Also, this is affecting previous Sail versions. I don't know how the maintenance policy is for this project, but I was using Sail ^1.7 and found out this bug that prevented the images from being built, as trying to install swoole from the PECL failed as the default PHP version was 8.1 and it did not have the required extension.

If previous versions are to be maintained this fix should be cherry picked to those.

@taylorotwell
Copy link
Member

taylorotwell commented Jan 19, 2022

@mist-01 Do we have a list of the other recommended packages that would not be installed? I'm a little worried this is just going to break other things.

@hluaces
Copy link

hluaces commented Jan 19, 2022

@mist-01 Do we have a list of the other recommended packages that would not be installed? I'm a little worried this is just going to break other things.

I'm not OP but this is the list:

autopoint
bsdextrautils
build-essential
debhelper
debugedit
dh-autoreconf
dh-strip-nondeterminism
dpkg-dev
dwz
fakeroot
g++
g++-10
gettext
gettext-base
groff-base
intltool-debian
libalgorithm-diff-perl
libalgorithm-diff-xs-perl
libalgorithm-merge-perl
libarchive-cpio-perl
libarchive-zip-perl
libdebhelper-perl
libdw1
libelf1
libfakeroot
libfile-fcntllock-perl
libfile-stripnondeterminism-perl
libglib2.0-data
liblocale-gettext-perl
libltdl-dev
libltdl7
libmail-sendmail-perl
libpipeline1
libstdc++-10-dev
libsub-override-perl
libsys-hostname-long-perl
libuchardet0
lto-disabled-list
make
man-db
php-json
php-pear
php8.1-cli
php8.1-common
php8.1-opcache
php8.1-phpdbg
php8.1-readline
pkg-php-tools
po-debconf
shared-mime-info
xdg-user-dirs

@michalkortas
Copy link

For me problem was solved when I added to Dockerfile this code after RUN apt-get.
RUN update-alternatives --set php /usr/bin/php8.0

@mist-01
Copy link
Contributor Author

mist-01 commented Jan 20, 2022

For me problem was solved when I added to Dockerfile this code after RUN apt-get. RUN update-alternatives --set php /usr/bin/php8.0

This could work too, it will leave php8.1 installed on the container.

Options mentioned so far:

  1. Add --no-install-recommends
  2. Add apt-get remove php8.1-cli call
  3. Add update-alternatives --set php /usr/bin/php8.0 call

Any thoughts on which one is least likely to break something else?

@driesvints driesvints mentioned this pull request Jan 20, 2022
@taylorotwell
Copy link
Member

Personally I think "Add update-alternatives --set php /usr/bin/php8.0 call" is safest.

@taylorotwell taylorotwell merged commit dbe4a90 into laravel:1.x Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using the 8.0 image the PHP version in the container is 8.1
4 participants