GD not support JPEG

  docker, php

I tried enabling GD JPEG with DOCKER but it doesn’t work. This is my dockerfile :

FROM php:7.4-apache
COPY ./app/. /var/www/html
RUN apt-get update && apt-get install -y  
    libzip-dev zip 
    zlib1g-dev 
    libjpeg-dev 
    libjpeg62-turbo-dev 
    libfreetype6-dev 
    libpng-dev


RUN docker-php-ext-install mysqli && a2enmod rewrite && service apache2 restart && chown -R www-data:www-data /var/www

RUN docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg

RUN docker-php-ext-install zip && docker-php-ext-install -j$(nproc) gd

But the result remains the same:

# php -r "print_r(gd_info());"
Array
(
    [GD Version] => bundled (2.1.0 compatible)
    [FreeType Support] =>
    [GIF Read Support] => 1
    [GIF Create Support] => 1
    [JPEG Support] =>
    [PNG Support] => 1
    [WBMP Support] => 1
    [XPM Support] =>
    [XBM Support] => 1
    [WebP Support] =>
    [BMP Support] => 1
    [TGA Read Support] => 1
    [JIS-mapped Japanese Font Support] =>
)

JPEG Support is still false.

Source: Docker Questions

LEAVE A COMMENT