mlocati / docker-php-extension-installer

Easily install PHP extensions in Docker containers
MIT License
4.3k stars 386 forks source link

Define/bump ICU version #974

Closed ro0NL closed 2 months ago

ro0NL commented 2 months ago

Hi,

I noticed currently ICU 72.1 is installed using install-php-extensions intl on a PHP 8.1 base image:

php -i | grep ICU
ICU version => 72.1
ICU Data version => 72.1
ICU TZData version => 2022e
ICU Unicode version => 15.0

ICU 75 is the latest version.

Im wondering if it can be bumped and/or made configurable.

mlocati commented 2 months ago

The script install the ICU library provided by the system (apk for Alpine and apt for Debian). For example:

I have no intention of making the script compile a specific version of ICU (it's already rather complex, and compiling system libraries is really out of scope, unless there's no alternative).

So, if you need a newer ICU version I think your only option is to compile it yourself.

ro0NL commented 2 months ago

fair point :)

i was hoping for a standard upstream solution within the docker-php ecosystem, given the relative importance of i18n/l10n in apps (ideally we stay in sync with symfony/intl data version: https://github.com/symfony/symfony/pull/58183)

here's an example Dockferfile https://github.com/jakzal/docker-symfony-intl/blob/master/Dockerfile for consideration, otherwise feel free to close.

mlocati commented 2 months ago

That's not so easy: you also have to tell apt/apk that ICU is already installed, otherwise it'll be overwritten.

For example: a PHP extensions require the library XYZ, and XYZ requires ICU. So, when installig XYZ, apt/apk will install ICU too.

The solution could be to manually compile & install ICU after apt/apk installs the system packages.

Thoughts?

ro0NL commented 2 months ago

installing ICU from source after apt/apk sounds reasonable, it will only run if ICU_VERSION is defined of course.

im not sure what currently installs ICU, but perhaps it can be excluded, also only if ICU_VERSION is defined.

ro0NL commented 2 months ago

i figured it's easier to simply rely on the system ICU version being installed, due to the complexity of controlling this version :)