Skip to content

Commit

Permalink
First cut of PHP 7.3-stretch
Browse files Browse the repository at this point in the history
Missing:
- solr: moodlehq#19
  • Loading branch information
stronk7 committed Jan 18, 2019
1 parent 917f2cd commit 634d9dd
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
32 changes: 17 additions & 15 deletions root/tmp/setup/php-extensions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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/
Expand All @@ -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
Expand Down
20 changes: 20 additions & 0 deletions root/tmp/setup/sqlsrv-extension.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 634d9dd

Please sign in to comment.