serversideup / docker-php

🐳 Production-ready Docker images for PHP. Optimized for Laravel, WordPress, and more!
https://serversideup.net/open-source/docker-php/
GNU General Public License v3.0
1.68k stars 109 forks source link

Install docker-php-extension-installer by default #237

Closed jaydrogers closed 9 months ago

jaydrogers commented 9 months ago

Discussed in https://github.com/serversideup/docker-php/discussions/236

Originally posted by **jaydrogers** November 30, 2023 # 👉 Describe the problem [comment]: <> (What are you trying to solve?) Adding PHP extensions is difficult because you need to know all the dependent packages. # 👥 Problem evidence & reach [comment]: <> (How many people have this problem?) Anyone who wants to customize their image. For example, anyone adding Redis, PGSQL, etc. # 🏆 How to solve this problem [comment]: <> (Describe the feature that you are proposing and how it will solve the problem) ### Install `docker-php-extension-installer` by default There is an open source project called [docker-php-extension-installer](https://github.com/mlocati/docker-php-extension-installer) that helps installs extensions. - [x] Include this in all images and install it - [x] Ensure all images are updated to use this new method ### Document how to use this - [x] Show how to install common extensions - Redis - pgsql - imagick # 🥰 Describe the "impact" on users? [comment]: <> (How will this make people's lives better once it is solved?) - Users will have a much easier time installing extensions. - Maintainers will answer a lot less questions on how to install extensions. # 💯 How do we validate the problem is solved? [comment]: <> (Explain use cases on how we can measure the success of this implementation) - [x] Users can run `install-php-extensions` in every image variation - [x] Everything is clearly documented
lemniskett commented 9 months ago

It doesn't make sense to add docker-php-extension-installer because this image uses Ondrej's PHP which is installable from apt. why not something like this instead?


FROM docker.io/serversideup/php:8.2-fpm-apache
RUN set -ex; \
    apt update; \
    apt install -y php8.2-pgsql        
jaydrogers commented 9 months ago

@lemniskett In v3.0, we're building on top of the Official PHP images. This means no more Ubuntu, and we'll have Debian and Alpine instead.

Ondrej PHP PPA will also be disappearing too.

Read this comment for more details: https://github.com/serversideup/docker-php/pull/207#issue-1897082822

jaydrogers commented 9 months ago

This has been implemented and has dramatically improved the user experience while saving a ton of space 🥳

https://github.com/serversideup/docker-php/issues/234#issuecomment-1836891533