Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

303
Views
GD library for Docker image with php:7.1-fpm

I have a Docker container

FROM php:7.1-fpm

RUN apt-get update \
    && apt-get install -y \
    && docker-php-ext-install mysqli pdo_mysql

WORKDIR /var/www

CMD ["php-fpm"]

COPY nginx/www /var/www
COPY php/php /usr/local/etc/php

I tried to add some various code for installing GD library but all they didn't work.

I tried to add this

# GD LIB
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
RUN docker-php-ext-install -j$(nproc) iconv mcrypt zip pdo gd bcmath

I want to add GD library for PHP. Help me, please.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

FROM php:7.1-fpm

RUN apt-get update \
    && apt-get install -y \
    && docker-php-ext-install mysqli pdo_mysql

WORKDIR /var/www

RUN apt-get update && apt-get install -y libpng-dev
RUN apt-get install -y \
    libwebp-dev \
    libjpeg62-turbo-dev \
    libpng-dev libxpm-dev \
    libfreetype6-dev

RUN docker-php-ext-configure gd \
    --with-gd \
    --with-webp-dir \
    --with-jpeg-dir \
    --with-png-dir \
    --with-zlib-dir \
    --with-xpm-dir \
    --with-freetype-dir \
    --enable-gd-native-ttf

RUN docker-php-ext-install gd

CMD ["php-fpm"]

Try this code this working after build image run container and check container logs. show below result.

[15-May-2019 11:46:34] NOTICE: fpm is running, pid 1
[15-May-2019 11:46:34] NOTICE: ready to handle connections

Also, add nginx installation code.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!