From eaed50db3ea45d4c2582cd2b413e70e11b8e3879 Mon Sep 17 00:00:00 2001 From: "FiveFilters.org" Date: Tue, 10 Aug 2021 23:55:27 +0200 Subject: Support PHP 7.3-8.0 and Libxml 2.9.4, 2.9.5, 2.9.10 and 2.9.12 via Docker --- docker/php/Dockerfile | 41 +++++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) (limited to 'docker') diff --git a/docker/php/Dockerfile b/docker/php/Dockerfile index c1fef3d..58a2eb3 100644 --- a/docker/php/Dockerfile +++ b/docker/php/Dockerfile @@ -1,13 +1,38 @@ -ARG PHP_VERSION -ARG LIBXML_VERSION -FROM andreskrey/php-${PHP_VERSION}:libxml-${LIBXML_VERSION} +ARG PHP_VERSION=8 +FROM php:${PHP_VERSION}-cli -RUN apt-get update +# Install sqlite and libonig-dev (required for building PHP 7.4) +RUN apt-get update && apt-get install -y libsqlite3-dev libonig-dev +# Install custom version of libxml2 +RUN apt-get install -y automake libtool unzip libssl-dev +# Remove current version +RUN apt-get remove -y libxml2 +# Download new version, configure and compile +ARG LIBXML_VERSION=2.9.12 +RUN curl https://gitlab.gnome.org/GNOME/libxml2/-/archive/v$LIBXML_VERSION/libxml2-v$LIBXML_VERSION.zip -o /tmp/libxml.zip && \ + cd /tmp && \ + unzip libxml.zip && \ + cd libxml2-v$LIBXML_VERSION && \ + ./autogen.sh --libdir=/usr/lib/x86_64-linux-gnu && \ + make && \ + make install +# Recompile PHP with the new libxml2 library +RUN docker-php-source extract && \ + cd /usr/src/php && \ + ./configure \ + --with-libxml-dir=/usr/lib/x86_64-linux-gnu \ + --enable-mbstring \ + --with-openssl \ + --with-config-file-path=/usr/local/etc/php \ + --with-config-file-scan-dir=/usr/local/etc/php/conf.d && \ + make && make install && \ + docker-php-source delete -# Check if there's a pinned version of Xdebug for compatibility reasons -ARG XDEBUG_VERSION -RUN pecl install xdebug$(if [ ! ${XDEBUG_VERSION} = '' ]; then echo -${XDEBUG_VERSION} ; fi) && docker-php-ext-enable xdebug +#RUN apt-get update +# Check if there's a pinned version of Xdebug for compatibility reasons +#ARG XDEBUG_VERSION +#RUN pecl install xdebug$(if [ ! ${XDEBUG_VERSION} = '' ]; then echo -${XDEBUG_VERSION} ; fi) && docker-php-ext-enable xdebug # Required by coveralls -RUN apt-get install git -y +#RUN apt-get install git -y -- cgit v1.2.3