From 0226e0ca0dc70f9a0310b3eef045ee1c1e0ca3ac Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 13 Dec 2022 20:00:46 +0300 Subject: split into a separate repo --- .../readability.php/docker/php/Dockerfile | 16 +++++++ .../readability.php/docker/php/build.Dockerfile | 56 ++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 vendor/fivefilters/readability.php/docker/php/Dockerfile create mode 100644 vendor/fivefilters/readability.php/docker/php/build.Dockerfile (limited to 'vendor/fivefilters/readability.php/docker') diff --git a/vendor/fivefilters/readability.php/docker/php/Dockerfile b/vendor/fivefilters/readability.php/docker/php/Dockerfile new file mode 100644 index 0000000..e19a366 --- /dev/null +++ b/vendor/fivefilters/readability.php/docker/php/Dockerfile @@ -0,0 +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 fivefilters/php-libxml:php-${PHP_VERSION}-libxml-${LIBXML_VERSION} + +RUN apt-get update \ No newline at end of file diff --git a/vendor/fivefilters/readability.php/docker/php/build.Dockerfile b/vendor/fivefilters/readability.php/docker/php/build.Dockerfile new file mode 100644 index 0000000..270b6d9 --- /dev/null +++ b/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 -- cgit v1.2.3