From 634d9dd0c852d07eb9ed3a29ed0fd6cbc597873a Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Fri, 18 Jan 2019 13:15:49 +0100 Subject: [PATCH] First cut of PHP 7.3-stretch Missing: - solr: https://github.com/moodlehq/moodle-php-apache/issues/19 --- Dockerfile | 2 +- root/tmp/setup/php-extensions.sh | 32 ++++++++++++++++-------------- root/tmp/setup/sqlsrv-extension.sh | 20 +++++++++++++++++++ 3 files changed, 38 insertions(+), 16 deletions(-) create mode 100755 root/tmp/setup/sqlsrv-extension.sh diff --git a/Dockerfile b/Dockerfile index ba5cf47..686e3b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM php:7.1-apache-stretch +FROM php:7.3-apache-stretch ADD root/ / # Fix the original permissions of /tmp, the PHP default upload tmp dir. diff --git a/root/tmp/setup/php-extensions.sh b/root/tmp/setup/php-extensions.sh index e888fe0..d04058e 100755 --- a/root/tmp/setup/php-extensions.sh +++ b/root/tmp/setup/php-extensions.sh @@ -7,7 +7,7 @@ echo "Installing apt dependencies" # Build packages will be added during the build, but will be removed at the end. BUILD_PACKAGES="gettext gnupg libcurl4-openssl-dev libfreetype6-dev libicu-dev libjpeg62-turbo-dev \ libldap2-dev libmariadbclient-dev libmemcached-dev libpng-dev libpq-dev libxml2-dev libxslt-dev \ - unixodbc-dev zlib1g-dev" + unixodbc-dev" # Packages for Postgres. PACKAGES_POSTGRES="libpq5" @@ -16,7 +16,8 @@ PACKAGES_POSTGRES="libpq5" PACKAGES_MYMARIA="libmariadbclient18" # Packages for other Moodle runtime dependenices. -PACKAGES_RUNTIME="ghostscript libaio1 libcurl3 libgss3 libicu57 libmcrypt-dev libxml2 libxslt1.1 locales sassc unzip unixodbc sassc" +PACKAGES_RUNTIME="ghostscript libaio1 libcurl3 libgss3 libicu57 libmcrypt-dev libxml2 libxslt1.1 \ + libzip-dev locales sassc unixodbc unzip zip" # Packages for Memcached. PACKAGES_MEMCACHED="libmemcached11 libmemcachedutil2" @@ -47,8 +48,7 @@ docker-php-ext-install -j$(nproc) \ pgsql \ soap \ xsl \ - xmlrpc \ - zip + xmlrpc # GD. docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ @@ -58,20 +58,22 @@ docker-php-ext-install -j$(nproc) gd docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ docker-php-ext-install -j$(nproc) ldap -# SOLR, Memcached, Redis, APCu, igbinary. -pecl install solr memcached redis apcu igbinary -docker-php-ext-enable solr memcached redis apcu igbinary +# Note solr is missing. Ref: https://github.com/moodlehq/moodle-php-apache/issues/19 -echo 'apc.enable_cli = On' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini +# Memcached, MongoDB, Redis, APCu, igbinary. +pecl install memcached mongodb redis apcu igbinary +docker-php-ext-enable memcached redis apcu igbinary -# Install Microsoft dependcies for sqlsrv. -curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - -curl https://packages.microsoft.com/config/debian/9/prod.list -o /etc/apt/sources.list.d/mssql-release.list -apt-get update -ACCEPT_EULA=Y apt-get install -y msodbcsql17 +# ZIP +docker-php-ext-configure zip --with-libzip +docker-php-ext-install zip + +echo 'apc.enable_cli = On' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini -pecl install sqlsrv -docker-php-ext-enable sqlsrv +# Install Microsoft dependencies for sqlsrv. +# (kept apart for clarity, still need to be run here +# before some build packages are deleted) +/tmp/setup/sqlsrv-extension.sh # Keep our image size down.. pecl clear-cache diff --git a/root/tmp/setup/sqlsrv-extension.sh b/root/tmp/setup/sqlsrv-extension.sh new file mode 100755 index 0000000..c6f87db --- /dev/null +++ b/root/tmp/setup/sqlsrv-extension.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +set -e + +# Install Microsoft dependencies for sqlsrv +# Debian 9 requires ODBC driver 17, still not package available in repos, so followed this +# https://github.com/Microsoft/msphpsql/wiki/Install-and-configuration#user-content-odbc-17-linux-installation +echo "Downloading sqlsrv files" +curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - +curl https://packages.microsoft.com/config/debian/9/prod.list -o /etc/apt/sources.list.d/mssql-release.list +apt-get update + +echo "Install msodbcsql" +ACCEPT_EULA=Y apt-get install -y msodbcsql17 + +ln -fsv /opt/mssql-tools/bin/* /usr/bin + +# Need 5.5.0preview (or later) for PHP 7.3 support +pecl install sqlsrv-5.5.0preview +docker-php-ext-enable sqlsrv