Install gd extension on php7.4 in Docker


Note

  • use --with-jpeg, not --with-jpeg-dir
  • use --with-freetype, not --with-freetype-dir

Example

# GD
# Setup GD extension
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev
RUN docker-php-ext-configure gd --with-freetype --with-jpeg
RUN docker-php-ext-install gd
RUN docker-php-ext-enable gd

refs : stackoverflow, php.net