summaryrefslogtreecommitdiff
path: root/docker
diff options
context:
space:
mode:
authorFiveFilters.org <[email protected]>2021-08-10 23:55:27 +0200
committerFiveFilters.org <[email protected]>2021-08-10 23:55:27 +0200
commiteaed50db3ea45d4c2582cd2b413e70e11b8e3879 (patch)
treec47b6d7ca0460f6e260a0ad08e6f2b54e18cb3d2 /docker
parent0d35f00d102aebe77a9599aa11acd13ad492f1e1 (diff)
Support PHP 7.3-8.0 and Libxml 2.9.4, 2.9.5, 2.9.10 and 2.9.12 via Docker
Diffstat (limited to 'docker')
-rw-r--r--docker/php/Dockerfile41
1 files changed, 33 insertions, 8 deletions
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