Allow auto installing PHP extensions by an environment variable like: PHP_INSTALL_EXTENSIONS=gd,intl
#705
MurzNN
started this conversation in
Ideas & Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
👉 Describe the problem
I want use the
serversideup/phpPHP image in a Kubernetes pod to launch an app, but the image miss some required extensions, for example,php-gd👥 Problem evidence & reach
Try to run, eg, default clean Drupal setup on this image, it will fail because of missing
php-gdextension.🏆 How to solve this problem
A suggested workaround for this in the docs https://serversideup.net/open-source/docker-php/docs/customizing-the-image/installing-additional-php-extensions is build a custom image over
serversideup/phpwith manually installing required PHP extensions like this:But we can't do this directly in Kubernetes! To do this, we have to create a separate workflow, launch an own image registry, and push the extended image there.
These all is possible, but looks too much for a simple task like "just launch a Drupal website in my Kubernetes", right?
Proposed solutions
A much simpler way, that many other PHP images provide to simplify this task and make the image usable directly in Kubernetes and other environments without custom builds, is allow listing the required PHP extensions in an environment variable like
PHP_INSTALL_EXTENSIONS=gd,intl, and add a script that installs them on the image initialization stage.🥰 Describe the "impact" on users?
Having this, we will make image usable out of the box for different PHP frameworks and libraries that require additional PHP extensions, without requiring a custom build.
I know that this will slightly decrease the image startup time, but to mitigate this we can explicitly describe that this way is just for convenience, and it is not good for startup performance, and recommend building custom images to improve the performance.
💯 How do we validate the problem is solved?
Add a test that lists the
gd,intlextensions and checks that they are installed after the image startup.All reactions