Configuring GD and Freetype on WordPress Docker Image

This applies to official WordPress image but can be used with PHP image also.

Create Dockerfile with following contents:

FROM wordpress:latest

# Install gd and freetype
RUN apt-get -y update \
 && apt-get -y install php5-gd freetype* \
 && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
 && docker-php-ext-install -j$(nproc) gd

Build your image

docker build -t wordpress .

Or you can use my image here.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.