2

Is there any way to specify installed GD extension version? Currently I have following Dockerfile:

ARG PHP_VERSION=8.1.1

FROM php:${PHP_VERSION}-fpm-alpine

RUN apk add --update --no-cache freetype libpng libjpeg-turbo freetype-dev libpng-dev libjpeg-turbo-dev libwebp-dev \
    && docker-php-ext-configure gd \
    --with-freetype \
    --with-jpeg \
    --with-webp \
    NPROC=$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) \
    && docker-php-ext-install -j$(nproc) gd \
    && apk del --no-cache freetype-dev libpng-dev libjpeg-turbo-dev \
    && mkdir /var/lib/php  \
    && chown www-data:www-data /var/lib/php -R


COPY php/conf.d/php.ini $PHP_INI_DIR/conf.d/php.ini
COPY php/conf.d/php-cli.ini $PHP_INI_DIR/conf.d/php-cli.ini

CMD ["php-fpm"]

However from results of this command:

php -r "print_r(gd_info());"

I can see that the installed GD version is 2.1.0:

Array
(
    [GD Version] => bundled (2.1.0 compatible)
    [FreeType Support] => 1
    [FreeType Linkage] => with freetype
    [GIF Read Support] => 1
    [GIF Create Support] => 1
    [JPEG Support] => 1
    [PNG Support] => 1
    [WBMP Support] => 1
    [XPM Support] =>
    [XBM Support] => 1
    [WebP Support] => 1
    [BMP Support] => 1
    [AVIF Support] =>
    [TGA Read Support] => 1
    [JIS-mapped Japanese Font Support] =>
)

From the official GD documentation I can see that the version 2.1.0 is outdated not supported anymore and the current stable version is 2.3.3.

Ulrich Eckhardt
  • 16,572
  • 3
  • 28
  • 55
rvaliev
  • 1,051
  • 2
  • 12
  • 31
  • `docker-php-ext-install -j$(nproc) gd` that's the code you run. Check out what it does. If you only want to use it, i.e. have someone else fix it for you, you need to file a feature request rather. Speaking of those, did you check for any? Perhaps there are already patches available that you could test, in order to speed up their processing? – Ulrich Eckhardt Jan 18 '22 at 18:42

0 Answers0