diff options
Diffstat (limited to 'plugins/af_readability/vendor/fivefilters/readability.php/docker/php')
-rw-r--r-- | plugins/af_readability/vendor/fivefilters/readability.php/docker/php/Dockerfile | 18 | ||||
-rw-r--r-- | plugins/af_readability/vendor/fivefilters/readability.php/docker/php/build.Dockerfile | 56 |
2 files changed, 69 insertions, 5 deletions
diff --git a/plugins/af_readability/vendor/fivefilters/readability.php/docker/php/Dockerfile b/plugins/af_readability/vendor/fivefilters/readability.php/docker/php/Dockerfile index 8971d1f1b..e19a366cb 100644 --- a/plugins/af_readability/vendor/fivefilters/readability.php/docker/php/Dockerfile +++ b/plugins/af_readability/vendor/fivefilters/readability.php/docker/php/Dockerfile @@ -1,8 +1,16 @@ +# Load pre-built image of PHP (php-cli) and libxml. +# See https://hub.docker.com/r/fivefilters/php-libxml for supported versions +# Use build.Dockerfile to compile new versions of PHP/libxml + +# For reference, default package versions for Ubuntu are: +# Ubuntu 18.04 - php 7.2, libxml 2.9.4 +# Ubuntu 20.04 - php 7.4, libxml 2.9.10 +# Ubuntu 20.10 - php 7.4, libxml 2.9.10 +# Ubuntu 21.04 - php 7.4, libxml 2.9.10 +# Ubuntu 21.10 - php 8.0, libxml 2.9.10 + ARG PHP_VERSION ARG LIBXML_VERSION -FROM andreskrey/php-${PHP_VERSION}:libxml-${LIBXML_VERSION} - -RUN pecl install xdebug && docker-php-ext-enable xdebug +FROM fivefilters/php-libxml:php-${PHP_VERSION}-libxml-${LIBXML_VERSION} -# Required by coveralls -RUN apt-get install git -y +RUN apt-get update
\ No newline at end of file diff --git a/plugins/af_readability/vendor/fivefilters/readability.php/docker/php/build.Dockerfile b/plugins/af_readability/vendor/fivefilters/readability.php/docker/php/build.Dockerfile new file mode 100644 index 000000000..270b6d99a --- /dev/null +++ b/plugins/af_readability/vendor/fivefilters/readability.php/docker/php/build.Dockerfile @@ -0,0 +1,56 @@ +# Use this file to build a Docker image using the versions of PHP and Libxml specified. +# We have pre-built images at https://hub.docker.com/r/fivefilters/php-libxml which are faster to load than building from this file. +# To build using this file, use the following command from the root project folder (replace version of PHP/Libxml with the ones you want to use): +# docker build --build-arg PHP_VERSION=7.4 --build-arg LIBXML_VERSION=2.9.12 -t php-libxml -f ./docker/php/Dockerfile . + +# To upload the image to Docker Hub, the tag (-t) value should be something like org/repo:tag, e.g. for us, fivefilters/php-libxml:php-8-libxml-2.9.12 +# The tag can be applied afterwards too, e.g. docker tag php-libxml org/repo:tag + +ARG PHP_VERSION=8 +FROM php:${PHP_VERSION}-cli + +# Install sqlite and libonig-dev (required for building PHP 7.4) +RUN apt-get update && apt-get install -y libsqlite3-dev libonig-dev +# Install libsodium (package doesn't work for some reason) +RUN curl https://download.libsodium.org/libsodium/releases/LATEST.tar.gz -o /tmp/libsodium.tar.gz && \ + cd /tmp && \ + tar -xzf libsodium.tar.gz && \ + cd libsodium-stable/ && \ + ./configure && \ + make && make check && \ + make install +# 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 \ + --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 + +RUN apt-get update + +#RUN pecl install libsodium + +# 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 |