Skip to content

Commit

Permalink
Add WebP support for PHP GD (#91)
Browse files Browse the repository at this point in the history
Add WebP support for PHP GD
  • Loading branch information
sean-e-dietrich authored and lmakarov committed Jan 4, 2019
1 parent d735001 commit 0ad87d6
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 5 deletions.
11 changes: 10 additions & 1 deletion 5.6/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ RUN set -xe; \
libpng-dev \
libpq-dev \
libssh2-1-dev \
libxpm-dev \
libvpx-dev \
libxslt1-dev \
zlib1g-dev \
"; \
Expand All @@ -158,10 +160,17 @@ RUN set -xe; \
libpq5 \
libssh2-1 \
libsybdb5 \
libxpm4 \
libvpx4 \
libxslt1.1 \
zlib1g \
;\
docker-php-ext-configure >/dev/null gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/; \
docker-php-ext-configure >/dev/null gd \
--with-freetype-dir=/usr/include/ \
--with-jpeg-dir=/usr/include/ \
--with-vpx-dir=/usr/include/ \
--with-png-dir=/usr/include/ \
--with-xpm-dir=/usr/include/; \
docker-php-ext-configure >/dev/null imap --with-kerberos --with-imap-ssl; \
docker-php-ext-configure >/dev/null ldap --with-libdir=lib/x86_64-linux-gnu/; \
# mssql can be install in PHP 5.6 only. pdo_dblib is available in PHP 7.0+ as well.
Expand Down
11 changes: 10 additions & 1 deletion 7.0/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ RUN set -xe; \
sudo \
supervisor \
unzip \
webp \
zip \
;\
# Cleanup
Expand Down Expand Up @@ -138,7 +139,9 @@ RUN set -xe; \
libmhash-dev \
libpng-dev \
libpq-dev \
libwebp-dev \
libssh2-1-dev \
libxpm-dev \
libxslt1-dev \
unixodbc-dev \
zlib1g-dev \
Expand All @@ -165,13 +168,19 @@ RUN set -xe; \
libpq5 \
libssh2-1 \
libxslt1.1 \
libxpm4 \
msodbcsql17 \
zlib1g \
;\
# SSH2 must be installed from source
git clone https://github.com/php/pecl-networking-ssh2.git /usr/src/php/ext/ssh2 && rm -rf /usr/src/php/ext/ssh2/.git; \
\
docker-php-ext-configure >/dev/null gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/; \
docker-php-ext-configure >/dev/null gd \
--with-freetype-dir=/usr/include/ \
--with-jpeg-dir=/usr/include/ \
--with-webp-dir=/usr/include/ \
--with-png-dir=/usr/include/ \
--with-xpm-dir=/usr/include/; \
docker-php-ext-configure >/dev/null imap --with-kerberos --with-imap-ssl; \
docker-php-ext-configure >/dev/null ldap --with-libdir=lib/x86_64-linux-gnu/; \
docker-php-ext-configure >/dev/null pgsql --with-pgsql=/usr/local/pgsql/; \
Expand Down
11 changes: 10 additions & 1 deletion 7.1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ RUN set -xe; \
sudo \
supervisor \
unzip \
webp \
zip \
;\
# Cleanup
Expand Down Expand Up @@ -138,7 +139,9 @@ RUN set -xe; \
libmhash-dev \
libpng-dev \
libpq-dev \
libwebp-dev \
libssh2-1-dev \
libxpm-dev \
libxslt1-dev \
unixodbc-dev \
zlib1g-dev \
Expand All @@ -164,14 +167,20 @@ RUN set -xe; \
libpng16-16 \
libpq5 \
libssh2-1 \
libxpm4 \
libxslt1.1 \
msodbcsql17 \
zlib1g \
;\
# SSH2 must be installed from source
git clone https://github.com/php/pecl-networking-ssh2.git /usr/src/php/ext/ssh2 && rm -rf /usr/src/php/ext/ssh2/.git; \
\
docker-php-ext-configure >/dev/null gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/; \
docker-php-ext-configure >/dev/null gd \
--with-freetype-dir=/usr/include/ \
--with-jpeg-dir=/usr/include/ \
--with-webp-dir=/usr/include/ \
--with-png-dir=/usr/include/ \
--with-xpm-dir=/usr/include/; \
docker-php-ext-configure >/dev/null imap --with-kerberos --with-imap-ssl; \
docker-php-ext-configure >/dev/null ldap --with-libdir=lib/x86_64-linux-gnu/; \
docker-php-ext-configure >/dev/null pgsql --with-pgsql=/usr/local/pgsql/; \
Expand Down
11 changes: 10 additions & 1 deletion 7.2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ RUN set -xe; \
sudo \
supervisor \
unzip \
webp \
zip \
;\
# Cleanup
Expand Down Expand Up @@ -138,7 +139,9 @@ RUN set -xe; \
libmhash-dev \
libpng-dev \
libpq-dev \
libwebp-dev \
libssh2-1-dev \
libxpm-dev \
libxslt1-dev \
unixodbc-dev \
zlib1g-dev \
Expand All @@ -164,6 +167,7 @@ RUN set -xe; \
libpng16-16 \
libpq5 \
libssh2-1 \
libxpm4 \
libxslt1.1 \
msodbcsql17 \
zlib1g \
Expand All @@ -173,7 +177,12 @@ RUN set -xe; \
# XDEBUG must be installed from source
git clone https://github.com/xdebug/xdebug.git /usr/src/php/ext/xdebug && rm -rf /usr/src/php/ext/xdebug/.git; \
\
docker-php-ext-configure >/dev/null gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/; \
docker-php-ext-configure >/dev/null gd \
--with-freetype-dir=/usr/include/ \
--with-jpeg-dir=/usr/include/ \
--with-webp-dir=/usr/include/ \
--with-png-dir=/usr/include/ \
--with-xpm-dir=/usr/include/; \
docker-php-ext-configure >/dev/null imap --with-kerberos --with-imap-ssl; \
docker-php-ext-configure >/dev/null ldap --with-libdir=lib/x86_64-linux-gnu/; \
docker-php-ext-configure >/dev/null pgsql --with-pgsql=/usr/local/pgsql/; \
Expand Down
11 changes: 10 additions & 1 deletion 7.3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ RUN set -xe; \
sudo \
supervisor \
unzip \
webp \
zip \
;\
# Cleanup
Expand Down Expand Up @@ -138,7 +139,9 @@ RUN set -xe; \
libmhash-dev \
libpng-dev \
libpq-dev \
libwebp-dev \
libssh2-1-dev \
libxpm-dev \
libxslt1-dev \
libzip-dev \
"; \
Expand All @@ -163,6 +166,7 @@ RUN set -xe; \
libpng16-16 \
libpq5 \
libssh2-1 \
libxpm4 \
libxslt1.1 \
libzip4 \
msodbcsql17 \
Expand All @@ -172,7 +176,12 @@ RUN set -xe; \
# XDEBUG must be installed from source
git clone https://github.com/xdebug/xdebug.git /usr/src/php/ext/xdebug && rm -rf /usr/src/php/ext/xdebug/.git; \
\
docker-php-ext-configure >/dev/null gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/; \
docker-php-ext-configure >/dev/null gd \
--with-freetype-dir=/usr/include/ \
--with-jpeg-dir=/usr/include/ \
--with-webp-dir=/usr/include/ \
--with-png-dir=/usr/include/ \
--with-xpm-dir=/usr/include/; \
docker-php-ext-configure >/dev/null imap --with-kerberos --with-imap-ssl; \
docker-php-ext-configure >/dev/null ldap --with-libdir=lib/x86_64-linux-gnu/; \
docker-php-ext-configure >/dev/null pgsql --with-pgsql=/usr/local/pgsql/; \
Expand Down
5 changes: 5 additions & 0 deletions tests/test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ _healthcheck_wait ()
echo "$output" | grep "${VERSION}"
unset output

# Confirm WebP support enabled for GD
output=$(echo "$phpInfo" | grep "WebP Support")
echo "$output" | grep "enabled"
unset output

output=$(echo "$phpInfo" | grep "memory_limit")
echo "$output" | grep "memory_limit => 1024M => 1024M"
unset output
Expand Down

0 comments on commit 0ad87d6

Please sign in to comment.