2018-02-17 01:40:13 +08:00
|
|
|
#
|
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Image Setup
|
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# To edit the 'php-fpm' base Image, visit its repository on Github
|
|
|
|
# https://github.com/Laradock/php-fpm
|
|
|
|
#
|
|
|
|
# To change its version, see the available Tags on the Docker Hub:
|
|
|
|
# https://hub.docker.com/r/laradock/php-fpm/tags/
|
|
|
|
#
|
|
|
|
# Note: Base Image name format {image-tag}-{php-version}
|
|
|
|
#
|
|
|
|
|
2018-07-29 12:00:13 +08:00
|
|
|
ARG LARADOCK_PHP_VERSION
|
2020-04-17 11:57:50 +08:00
|
|
|
ARG BASE_IMAGE_TAG_PREFIX=latest
|
|
|
|
FROM laradock/php-fpm:${BASE_IMAGE_TAG_PREFIX}-${LARADOCK_PHP_VERSION}
|
2018-02-17 01:40:13 +08:00
|
|
|
|
2018-03-16 17:34:47 +08:00
|
|
|
LABEL maintainer="Mahmoud Zalt <mahmoud@zalt.me>"
|
2018-02-17 01:40:13 +08:00
|
|
|
|
2018-07-29 12:00:13 +08:00
|
|
|
ARG LARADOCK_PHP_VERSION
|
|
|
|
|
2018-06-27 18:47:05 +08:00
|
|
|
# Set Environment Variables
|
|
|
|
ENV DEBIAN_FRONTEND noninteractive
|
|
|
|
|
2019-08-09 08:52:32 +08:00
|
|
|
# If you're in China, or you need to change sources, will be set CHANGE_SOURCE to true in .env.
|
|
|
|
|
2019-09-12 08:36:11 +08:00
|
|
|
ARG CHANGE_SOURCE=false
|
|
|
|
RUN if [ ${CHANGE_SOURCE} = true ]; then \
|
|
|
|
# Change application source from deb.debian.org to aliyun source
|
2020-08-09 08:08:17 +08:00
|
|
|
sed -i 's/deb.debian.org/mirrors.aliyun.com/' /etc/apt/sources.list && \
|
|
|
|
sed -i 's/security.debian.org/mirrors.aliyun.com/' /etc/apt/sources.list && \
|
|
|
|
sed -i 's/security-cdn.debian.org/mirrors.aliyun.com/' /etc/apt/sources.list \
|
2019-09-12 08:36:11 +08:00
|
|
|
;fi
|
|
|
|
|
2018-05-27 10:06:00 +08:00
|
|
|
# always run apt update when start and after add new source list, then clean up at end.
|
2019-02-23 16:46:46 +08:00
|
|
|
RUN set -xe; \
|
|
|
|
apt-get update -yqq && \
|
|
|
|
pecl channel-update pecl.php.net && \
|
|
|
|
apt-get install -yqq \
|
|
|
|
apt-utils \
|
|
|
|
#
|
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Mandatory Software's Installation
|
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Mandatory Software's such as ("mcrypt", "pdo_mysql", "libssl-dev", ....)
|
|
|
|
# are installed on the base image 'laradock/php-fpm' image. If you want
|
|
|
|
# to add more Software's or remove existing one, you need to edit the
|
|
|
|
# base image (https://github.com/Laradock/php-fpm).
|
|
|
|
#
|
|
|
|
# next lines are here becase there is no auto build on dockerhub see https://github.com/laradock/laradock/pull/1903#issuecomment-463142846
|
|
|
|
libzip-dev zip unzip && \
|
2020-01-06 23:39:23 +08:00
|
|
|
if [ ${LARADOCK_PHP_VERSION} = "7.3" ] || [ ${LARADOCK_PHP_VERSION} = "7.4" ]; then \
|
|
|
|
docker-php-ext-configure zip; \
|
|
|
|
else \
|
|
|
|
docker-php-ext-configure zip --with-libzip; \
|
|
|
|
fi && \
|
2019-02-23 16:46:46 +08:00
|
|
|
# Install the zip extension
|
|
|
|
docker-php-ext-install zip && \
|
|
|
|
php -m | grep -q 'zip'
|
2018-02-17 01:40:13 +08:00
|
|
|
|
|
|
|
#
|
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Optional Software's Installation
|
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Optional Software's will only be installed if you set them to `true`
|
|
|
|
# in the `docker-compose.yml` before the build.
|
|
|
|
# Example:
|
2019-02-16 23:32:03 +08:00
|
|
|
# - INSTALL_SOAP=true
|
2018-02-17 01:40:13 +08:00
|
|
|
#
|
|
|
|
|
2020-02-11 23:56:58 +08:00
|
|
|
###########################################################################
|
|
|
|
# BZ2:
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
ARG INSTALL_BZ2=false
|
|
|
|
RUN if [ ${INSTALL_BZ2} = true ]; then \
|
|
|
|
apt-get -y install libbz2-dev; \
|
|
|
|
docker-php-ext-install bz2 \
|
|
|
|
;fi
|
|
|
|
|
2020-02-12 18:23:22 +08:00
|
|
|
###########################################################################
|
|
|
|
# GMP (GNU Multiple Precision):
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
ARG INSTALL_GMP=false
|
|
|
|
|
|
|
|
RUN if [ ${INSTALL_GMP} = true ]; then \
|
|
|
|
# Install the GMP extension
|
|
|
|
apt-get install -y libgmp-dev && \
|
|
|
|
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
|
|
|
|
ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h \
|
|
|
|
;fi && \
|
|
|
|
docker-php-ext-install gmp \
|
|
|
|
;fi
|
|
|
|
|
2018-08-28 14:16:25 +08:00
|
|
|
###########################################################################
|
|
|
|
# SSH2:
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
ARG INSTALL_SSH2=false
|
|
|
|
|
|
|
|
RUN if [ ${INSTALL_SSH2} = true ]; then \
|
|
|
|
# Install the ssh2 extension
|
|
|
|
apt-get -y install libssh2-1-dev && \
|
|
|
|
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
|
|
|
|
pecl install -a ssh2-0.13; \
|
|
|
|
else \
|
2020-02-18 13:45:23 +08:00
|
|
|
pecl install -a ssh2-1.2; \
|
2018-08-28 14:16:25 +08:00
|
|
|
fi && \
|
|
|
|
docker-php-ext-enable ssh2 \
|
|
|
|
;fi
|
|
|
|
|
2018-09-18 21:44:36 +08:00
|
|
|
###########################################################################
|
|
|
|
# libfaketime:
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
USER root
|
|
|
|
|
|
|
|
ARG INSTALL_FAKETIME=false
|
|
|
|
|
|
|
|
RUN if [ ${INSTALL_FAKETIME} = true ]; then \
|
|
|
|
apt-get install -y libfaketime \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
# SOAP:
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
|
|
|
|
ARG INSTALL_SOAP=false
|
2018-04-06 15:04:56 +08:00
|
|
|
|
2018-02-17 01:40:13 +08:00
|
|
|
RUN if [ ${INSTALL_SOAP} = true ]; then \
|
|
|
|
# Install the soap extension
|
2018-05-26 07:47:29 +08:00
|
|
|
rm /etc/apt/preferences.d/no-debian-php && \
|
2018-02-17 01:40:13 +08:00
|
|
|
apt-get -y install libxml2-dev php-soap && \
|
|
|
|
docker-php-ext-install soap \
|
|
|
|
;fi
|
|
|
|
|
2019-02-16 23:03:42 +08:00
|
|
|
###########################################################################
|
|
|
|
# XSL:
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
ARG INSTALL_XSL=false
|
|
|
|
|
|
|
|
RUN if [ ${INSTALL_XSL} = true ]; then \
|
|
|
|
# Install the xsl extension
|
|
|
|
apt-get -y install libxslt-dev && \
|
|
|
|
docker-php-ext-install xsl \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
# pgsql
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
|
|
|
|
ARG INSTALL_PGSQL=false
|
2018-04-06 15:04:56 +08:00
|
|
|
|
2018-02-17 01:40:13 +08:00
|
|
|
RUN if [ ${INSTALL_PGSQL} = true ]; then \
|
|
|
|
# Install the pgsql extension
|
|
|
|
docker-php-ext-install pgsql \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
# pgsql client
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
|
|
|
|
ARG INSTALL_PG_CLIENT=false
|
2019-05-08 18:17:08 +08:00
|
|
|
ARG INSTALL_POSTGIS=false
|
2018-04-06 15:04:56 +08:00
|
|
|
|
2018-02-17 01:40:13 +08:00
|
|
|
RUN if [ ${INSTALL_PG_CLIENT} = true ]; then \
|
2018-02-24 04:27:04 +08:00
|
|
|
# Create folders if not exists (https://github.com/tianon/docker-brew-debian/issues/65)
|
|
|
|
mkdir -p /usr/share/man/man1 && \
|
|
|
|
mkdir -p /usr/share/man/man7 && \
|
2018-02-17 01:40:13 +08:00
|
|
|
# Install the pgsql client
|
2019-05-08 18:17:08 +08:00
|
|
|
apt-get install -y postgresql-client && \
|
|
|
|
if [ ${INSTALL_POSTGIS} = true ]; then \
|
|
|
|
apt-get install -y postgis; \
|
|
|
|
fi \
|
2018-02-17 01:40:13 +08:00
|
|
|
;fi
|
|
|
|
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
# xDebug:
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
|
|
|
|
ARG INSTALL_XDEBUG=false
|
2018-04-06 15:04:56 +08:00
|
|
|
|
2018-02-17 01:40:13 +08:00
|
|
|
RUN if [ ${INSTALL_XDEBUG} = true ]; then \
|
2018-05-26 07:32:33 +08:00
|
|
|
# Install the xdebug extension
|
|
|
|
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
|
|
|
|
pecl install xdebug-2.5.5; \
|
|
|
|
else \
|
2020-02-18 09:56:45 +08:00
|
|
|
if [ $(php -r "echo PHP_MINOR_VERSION;") = "0" ]; then \
|
|
|
|
pecl install xdebug-2.9.0; \
|
|
|
|
else \
|
|
|
|
pecl install xdebug; \
|
|
|
|
fi \
|
2018-05-26 07:32:33 +08:00
|
|
|
fi && \
|
|
|
|
docker-php-ext-enable xdebug \
|
2018-02-17 01:40:13 +08:00
|
|
|
;fi
|
|
|
|
|
|
|
|
# Copy xdebug configuration for remote debugging
|
|
|
|
COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
|
|
|
|
|
2018-06-24 09:46:12 +08:00
|
|
|
RUN sed -i "s/xdebug.remote_autostart=0/xdebug.remote_autostart=1/" /usr/local/etc/php/conf.d/xdebug.ini && \
|
|
|
|
sed -i "s/xdebug.remote_enable=0/xdebug.remote_enable=1/" /usr/local/etc/php/conf.d/xdebug.ini && \
|
|
|
|
sed -i "s/xdebug.cli_color=0/xdebug.cli_color=1/" /usr/local/etc/php/conf.d/xdebug.ini
|
|
|
|
|
2019-08-05 02:07:05 +08:00
|
|
|
###########################################################################
|
|
|
|
# pcov:
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
USER root
|
|
|
|
|
|
|
|
ARG INSTALL_PCOV=false
|
|
|
|
|
|
|
|
RUN if [ ${INSTALL_PCOV} = true ]; then \
|
|
|
|
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ]; then \
|
2019-08-05 21:54:15 +08:00
|
|
|
if [ $(php -r "echo PHP_MINOR_VERSION;") != "0" ]; then \
|
2019-08-05 02:07:05 +08:00
|
|
|
pecl install pcov && \
|
2019-08-05 22:45:12 +08:00
|
|
|
docker-php-ext-enable pcov \
|
2019-08-05 02:07:05 +08:00
|
|
|
;fi \
|
|
|
|
;fi \
|
|
|
|
;fi
|
|
|
|
|
2018-06-30 16:54:46 +08:00
|
|
|
###########################################################################
|
|
|
|
# Phpdbg:
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
ARG INSTALL_PHPDBG=false
|
|
|
|
|
|
|
|
RUN if [ ${INSTALL_PHPDBG} = true ]; then \
|
|
|
|
# Load the xdebug extension only with phpunit commands
|
2018-07-29 12:00:13 +08:00
|
|
|
apt-get install -y --force-yes php${LARADOCK_PHP_VERSION}-phpdbg \
|
2018-06-30 16:54:46 +08:00
|
|
|
;fi
|
|
|
|
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
# Blackfire:
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
|
|
|
|
ARG INSTALL_BLACKFIRE=false
|
2018-04-06 15:04:56 +08:00
|
|
|
|
2018-02-17 01:40:13 +08:00
|
|
|
RUN if [ ${INSTALL_XDEBUG} = false -a ${INSTALL_BLACKFIRE} = true ]; then \
|
|
|
|
version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \
|
|
|
|
&& curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$version \
|
|
|
|
&& tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp \
|
|
|
|
&& mv /tmp/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so \
|
|
|
|
&& printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8707\n" > $PHP_INI_DIR/conf.d/blackfire.ini \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
|
|
|
# PHP REDIS EXTENSION
|
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
|
|
|
|
ARG INSTALL_PHPREDIS=false
|
2018-04-06 15:04:56 +08:00
|
|
|
|
2018-02-17 01:40:13 +08:00
|
|
|
RUN if [ ${INSTALL_PHPREDIS} = true ]; then \
|
|
|
|
# Install Php Redis Extension
|
2019-07-04 15:05:03 +08:00
|
|
|
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
|
|
|
|
pecl install -o -f redis-4.3.0; \
|
|
|
|
else \
|
|
|
|
pecl install -o -f redis; \
|
|
|
|
fi \
|
|
|
|
&& rm -rf /tmp/pear \
|
|
|
|
&& docker-php-ext-enable redis \
|
2018-02-17 01:40:13 +08:00
|
|
|
;fi
|
|
|
|
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
|
|
|
# Swoole EXTENSION
|
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
|
|
|
|
ARG INSTALL_SWOOLE=false
|
2018-04-06 15:04:56 +08:00
|
|
|
|
2018-02-17 01:40:13 +08:00
|
|
|
RUN if [ ${INSTALL_SWOOLE} = true ]; then \
|
|
|
|
# Install Php Swoole Extension
|
2018-05-27 19:47:13 +08:00
|
|
|
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
|
2019-02-23 00:52:14 +08:00
|
|
|
pecl install swoole-2.0.10; \
|
2018-05-27 19:47:13 +08:00
|
|
|
else \
|
2018-06-18 21:27:23 +08:00
|
|
|
if [ $(php -r "echo PHP_MINOR_VERSION;") = "0" ]; then \
|
|
|
|
pecl install swoole-2.2.0; \
|
|
|
|
else \
|
|
|
|
pecl install swoole; \
|
|
|
|
fi \
|
2018-05-27 19:47:13 +08:00
|
|
|
fi && \
|
|
|
|
docker-php-ext-enable swoole \
|
2019-02-23 00:52:14 +08:00
|
|
|
&& php -m | grep -q 'swoole' \
|
2018-02-17 01:40:13 +08:00
|
|
|
;fi
|
|
|
|
|
2019-05-29 08:56:40 +08:00
|
|
|
###########################################################################
|
|
|
|
# Taint EXTENSION
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
ARG INSTALL_TAINT=false
|
|
|
|
|
|
|
|
RUN if [ ${INSTALL_TAINT} = true ]; then \
|
|
|
|
# Install Php TAINT Extension
|
|
|
|
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ]; then \
|
|
|
|
pecl install taint && \
|
|
|
|
docker-php-ext-enable taint && \
|
|
|
|
php -m | grep -q 'taint'; \
|
|
|
|
fi \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
# MongoDB:
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
|
|
|
|
ARG INSTALL_MONGO=false
|
2018-04-06 15:04:56 +08:00
|
|
|
|
2018-02-17 01:40:13 +08:00
|
|
|
RUN if [ ${INSTALL_MONGO} = true ]; then \
|
|
|
|
# Install the mongodb extension
|
2018-06-25 20:16:25 +08:00
|
|
|
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
|
|
|
|
pecl install mongo && \
|
|
|
|
docker-php-ext-enable mongo \
|
|
|
|
;fi && \
|
2018-02-17 01:40:13 +08:00
|
|
|
pecl install mongodb && \
|
|
|
|
docker-php-ext-enable mongodb \
|
|
|
|
;fi
|
|
|
|
|
2019-05-18 10:57:01 +08:00
|
|
|
###########################################################################
|
|
|
|
# Xhprof:
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
ARG INSTALL_XHPROF=false
|
|
|
|
|
|
|
|
RUN if [ ${INSTALL_XHPROF} = true ]; then \
|
2019-12-05 11:11:29 +08:00
|
|
|
# Install the php xhprof extension
|
2019-05-18 10:57:01 +08:00
|
|
|
if [ $(php -r "echo PHP_MAJOR_VERSION;") = 7 ]; then \
|
2019-10-25 17:15:41 +08:00
|
|
|
curl -L -o /tmp/xhprof.tar.gz "https://github.com/tideways/php-xhprof-extension/archive/v5.0.1.tar.gz"; \
|
2019-05-18 10:57:01 +08:00
|
|
|
else \
|
|
|
|
curl -L -o /tmp/xhprof.tar.gz "https://codeload.github.com/phacility/xhprof/tar.gz/master"; \
|
|
|
|
fi \
|
|
|
|
&& mkdir -p xhprof \
|
|
|
|
&& tar -C xhprof -zxvf /tmp/xhprof.tar.gz --strip 1 \
|
|
|
|
&& ( \
|
|
|
|
cd xhprof \
|
|
|
|
&& phpize \
|
|
|
|
&& ./configure \
|
|
|
|
&& make \
|
|
|
|
&& make install \
|
|
|
|
) \
|
|
|
|
&& rm -r xhprof \
|
|
|
|
&& rm /tmp/xhprof.tar.gz \
|
|
|
|
;fi
|
|
|
|
|
|
|
|
COPY ./xhprof.ini /usr/local/etc/php/conf.d
|
|
|
|
|
2019-07-30 12:47:43 +08:00
|
|
|
RUN if [ ${INSTALL_XHPROF} = false ]; then \
|
|
|
|
rm /usr/local/etc/php/conf.d/xhprof.ini \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
# AMQP:
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
|
|
|
|
ARG INSTALL_AMQP=false
|
2018-04-06 15:04:56 +08:00
|
|
|
|
2018-02-17 01:40:13 +08:00
|
|
|
RUN if [ ${INSTALL_AMQP} = true ]; then \
|
2019-02-09 16:33:06 +08:00
|
|
|
# download and install manually, to make sure it's compatible with ampq installed by pecl later
|
|
|
|
# install cmake first
|
2020-02-11 18:41:19 +08:00
|
|
|
apt-get -y install cmake && \
|
2019-02-09 16:33:06 +08:00
|
|
|
curl -L -o /tmp/rabbitmq-c.tar.gz https://github.com/alanxz/rabbitmq-c/archive/master.tar.gz && \
|
|
|
|
mkdir -p rabbitmq-c && \
|
|
|
|
tar -C rabbitmq-c -zxvf /tmp/rabbitmq-c.tar.gz --strip 1 && \
|
|
|
|
cd rabbitmq-c/ && \
|
|
|
|
mkdir _build && cd _build/ && \
|
|
|
|
cmake .. && \
|
|
|
|
cmake --build . --target install && \
|
2018-02-17 01:40:13 +08:00
|
|
|
# Install the amqp extension
|
|
|
|
pecl install amqp && \
|
2019-01-08 15:35:22 +08:00
|
|
|
docker-php-ext-enable amqp && \
|
|
|
|
# Install the sockets extension
|
|
|
|
docker-php-ext-install sockets \
|
2018-02-17 01:40:13 +08:00
|
|
|
;fi
|
|
|
|
|
2019-07-25 18:03:21 +08:00
|
|
|
###########################################################################
|
|
|
|
# GEARMAN:
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
ARG INSTALL_GEARMAN=false
|
|
|
|
|
|
|
|
RUN if [ ${INSTALL_GEARMAN} = true ]; then \
|
|
|
|
apt-get -y install libgearman-dev && \
|
|
|
|
cd /tmp && \
|
|
|
|
curl -L https://github.com/wcgallego/pecl-gearman/archive/gearman-2.0.5.zip -O && \
|
|
|
|
unzip gearman-2.0.5.zip && \
|
|
|
|
mv pecl-gearman-gearman-2.0.5 pecl-gearman && \
|
|
|
|
cd /tmp/pecl-gearman && \
|
|
|
|
phpize && \
|
|
|
|
./configure && \
|
|
|
|
make -j$(nproc) && \
|
|
|
|
make install && \
|
|
|
|
cd / && \
|
|
|
|
rm /tmp/gearman-2.0.5.zip && \
|
|
|
|
rm -r /tmp/pecl-gearman && \
|
|
|
|
docker-php-ext-enable gearman \
|
|
|
|
;fi
|
|
|
|
|
2018-04-24 22:25:16 +08:00
|
|
|
###########################################################################
|
|
|
|
# pcntl
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
ARG INSTALL_PCNTL=false
|
2018-06-27 18:47:42 +08:00
|
|
|
RUN if [ ${INSTALL_PCNTL} = true ]; then \
|
2018-04-24 22:25:16 +08:00
|
|
|
# Installs pcntl, helpful for running Horizon
|
|
|
|
docker-php-ext-install pcntl \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
# bcmath:
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
|
|
|
|
ARG INSTALL_BCMATH=false
|
2018-04-06 15:04:56 +08:00
|
|
|
|
2018-02-17 01:40:13 +08:00
|
|
|
RUN if [ ${INSTALL_BCMATH} = true ]; then \
|
|
|
|
# Install the bcmath extension
|
|
|
|
docker-php-ext-install bcmath \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
# PHP Memcached:
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
|
|
|
|
ARG INSTALL_MEMCACHED=false
|
2018-04-06 15:04:56 +08:00
|
|
|
|
2018-02-17 01:40:13 +08:00
|
|
|
RUN if [ ${INSTALL_MEMCACHED} = true ]; then \
|
|
|
|
# Install the php memcached extension
|
2018-06-01 08:45:56 +08:00
|
|
|
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
|
2019-10-07 17:06:09 +08:00
|
|
|
pecl install memcached-2.2.0; \
|
2018-06-01 08:45:56 +08:00
|
|
|
else \
|
2019-10-07 17:06:09 +08:00
|
|
|
pecl install memcached-3.1.3; \
|
|
|
|
fi \
|
2018-02-17 01:40:13 +08:00
|
|
|
&& docker-php-ext-enable memcached \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
# Exif:
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
|
|
|
|
ARG INSTALL_EXIF=false
|
2018-04-06 15:04:56 +08:00
|
|
|
|
2018-02-17 01:40:13 +08:00
|
|
|
RUN if [ ${INSTALL_EXIF} = true ]; then \
|
|
|
|
# Enable Exif PHP extentions requirements
|
|
|
|
docker-php-ext-install exif \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
# PHP Aerospike:
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
|
|
|
|
2018-03-19 22:15:24 +08:00
|
|
|
USER root
|
2018-02-17 01:40:13 +08:00
|
|
|
|
|
|
|
ARG INSTALL_AEROSPIKE=false
|
|
|
|
|
2019-02-23 16:46:46 +08:00
|
|
|
RUN set -xe; \
|
|
|
|
if [ ${INSTALL_AEROSPIKE} = true ]; then \
|
2018-02-17 01:40:13 +08:00
|
|
|
# Fix dependencies for PHPUnit within aerospike extension
|
|
|
|
apt-get -y install sudo wget && \
|
2018-04-06 15:04:56 +08:00
|
|
|
# Install the php aerospike extension
|
2018-06-01 11:02:20 +08:00
|
|
|
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
|
|
|
|
curl -L -o /tmp/aerospike-client-php.tar.gz https://github.com/aerospike/aerospike-client-php5/archive/master.tar.gz; \
|
|
|
|
else \
|
2019-02-22 17:46:25 +08:00
|
|
|
curl -L -o /tmp/aerospike-client-php.tar.gz https://github.com/aerospike/aerospike-client-php/archive/master.tar.gz; \
|
2018-06-01 11:02:20 +08:00
|
|
|
fi \
|
2019-02-22 17:46:25 +08:00
|
|
|
&& mkdir -p /tmp/aerospike-client-php \
|
|
|
|
&& tar -C /tmp/aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \
|
2018-06-01 11:02:20 +08:00
|
|
|
&& \
|
|
|
|
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
|
|
|
|
( \
|
2019-02-22 17:46:25 +08:00
|
|
|
cd /tmp/aerospike-client-php/src/aerospike \
|
2018-06-01 11:02:20 +08:00
|
|
|
&& phpize \
|
|
|
|
&& ./build.sh \
|
|
|
|
&& make install \
|
|
|
|
) \
|
|
|
|
else \
|
|
|
|
( \
|
2019-02-22 17:46:25 +08:00
|
|
|
cd /tmp/aerospike-client-php/src \
|
2018-06-01 11:02:20 +08:00
|
|
|
&& phpize \
|
|
|
|
&& ./build.sh \
|
|
|
|
&& make install \
|
|
|
|
) \
|
|
|
|
fi \
|
2018-02-17 01:40:13 +08:00
|
|
|
&& rm /tmp/aerospike-client-php.tar.gz \
|
2018-03-19 22:15:24 +08:00
|
|
|
&& docker-php-ext-enable aerospike \
|
2018-02-17 01:40:13 +08:00
|
|
|
;fi
|
|
|
|
|
2018-09-08 21:31:05 +08:00
|
|
|
###########################################################################
|
2019-09-12 10:54:29 +08:00
|
|
|
# PHP OCI8:
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
ARG INSTALL_OCI8=false
|
|
|
|
|
|
|
|
ENV LD_LIBRARY_PATH="/opt/oracle/instantclient_12_1"
|
|
|
|
ENV OCI_HOME="/opt/oracle/instantclient_12_1"
|
|
|
|
ENV OCI_LIB_DIR="/opt/oracle/instantclient_12_1"
|
|
|
|
ENV OCI_INCLUDE_DIR="/opt/oracle/instantclient_12_1/sdk/include"
|
|
|
|
ENV OCI_VERSION=12
|
|
|
|
|
|
|
|
RUN if [ ${INSTALL_OCI8} = true ]; then \
|
|
|
|
# Install wget
|
|
|
|
apt-get update && apt-get install --no-install-recommends -y wget \
|
|
|
|
# Install Oracle Instantclient
|
|
|
|
&& mkdir /opt/oracle \
|
|
|
|
&& cd /opt/oracle \
|
|
|
|
&& wget https://github.com/diogomascarenha/oracle-instantclient/raw/master/instantclient-basic-linux.x64-12.1.0.2.0.zip \
|
|
|
|
&& wget https://github.com/diogomascarenha/oracle-instantclient/raw/master/instantclient-sdk-linux.x64-12.1.0.2.0.zip \
|
|
|
|
&& unzip /opt/oracle/instantclient-basic-linux.x64-12.1.0.2.0.zip -d /opt/oracle \
|
|
|
|
&& unzip /opt/oracle/instantclient-sdk-linux.x64-12.1.0.2.0.zip -d /opt/oracle \
|
|
|
|
&& ln -s /opt/oracle/instantclient_12_1/libclntsh.so.12.1 /opt/oracle/instantclient_12_1/libclntsh.so \
|
|
|
|
&& ln -s /opt/oracle/instantclient_12_1/libclntshcore.so.12.1 /opt/oracle/instantclient_12_1/libclntshcore.so \
|
|
|
|
&& ln -s /opt/oracle/instantclient_12_1/libocci.so.12.1 /opt/oracle/instantclient_12_1/libocci.so \
|
|
|
|
&& rm -rf /opt/oracle/*.zip \
|
|
|
|
# Install PHP extensions deps
|
|
|
|
&& apt-get update \
|
|
|
|
&& apt-get install --no-install-recommends -y \
|
|
|
|
libaio-dev \
|
|
|
|
freetds-dev && \
|
|
|
|
# Install PHP extensions
|
|
|
|
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
|
|
|
|
echo 'instantclient,/opt/oracle/instantclient_12_1/' | pecl install oci8-2.0.10; \
|
|
|
|
else \
|
|
|
|
echo 'instantclient,/opt/oracle/instantclient_12_1/' | pecl install oci8; \
|
|
|
|
fi \
|
|
|
|
&& docker-php-ext-configure pdo_oci --with-pdo-oci=instantclient,/opt/oracle/instantclient_12_1,12.1 \
|
|
|
|
&& docker-php-ext-configure pdo_dblib --with-libdir=/lib/x86_64-linux-gnu \
|
|
|
|
&& docker-php-ext-install \
|
|
|
|
pdo_oci \
|
|
|
|
&& docker-php-ext-enable \
|
|
|
|
oci8 \
|
|
|
|
;fi
|
|
|
|
|
2018-09-08 21:31:05 +08:00
|
|
|
###########################################################################
|
|
|
|
# IonCube Loader:
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
ARG INSTALL_IONCUBE=false
|
|
|
|
|
|
|
|
RUN if [ ${INSTALL_IONCUBE} = true ]; then \
|
|
|
|
# Install the php ioncube loader
|
|
|
|
curl -L -o /tmp/ioncube_loaders_lin_x86-64.tar.gz https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz \
|
|
|
|
&& tar zxpf /tmp/ioncube_loaders_lin_x86-64.tar.gz -C /tmp \
|
|
|
|
&& mv /tmp/ioncube/ioncube_loader_lin_${LARADOCK_PHP_VERSION}.so $(php -r "echo ini_get('extension_dir');")/ioncube_loader.so \
|
|
|
|
&& printf "zend_extension=ioncube_loader.so\n" > $PHP_INI_DIR/conf.d/0ioncube.ini \
|
|
|
|
&& rm -rf /tmp/ioncube* \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
# Opcache:
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
|
|
|
|
ARG INSTALL_OPCACHE=false
|
2018-04-06 15:04:56 +08:00
|
|
|
|
2018-02-17 01:40:13 +08:00
|
|
|
RUN if [ ${INSTALL_OPCACHE} = true ]; then \
|
|
|
|
docker-php-ext-install opcache \
|
|
|
|
;fi
|
|
|
|
|
|
|
|
# Copy opcache configration
|
|
|
|
COPY ./opcache.ini /usr/local/etc/php/conf.d/opcache.ini
|
|
|
|
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
# Mysqli Modifications:
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
|
|
|
|
ARG INSTALL_MYSQLI=false
|
2018-04-06 15:04:56 +08:00
|
|
|
|
2018-02-17 01:40:13 +08:00
|
|
|
RUN if [ ${INSTALL_MYSQLI} = true ]; then \
|
|
|
|
docker-php-ext-install mysqli \
|
|
|
|
;fi
|
|
|
|
|
|
|
|
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
# Human Language and Character Encoding Support:
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
|
|
|
|
ARG INSTALL_INTL=false
|
2018-04-06 15:04:56 +08:00
|
|
|
|
2018-02-17 01:40:13 +08:00
|
|
|
RUN if [ ${INSTALL_INTL} = true ]; then \
|
|
|
|
# Install intl and requirements
|
|
|
|
apt-get install -y zlib1g-dev libicu-dev g++ && \
|
|
|
|
docker-php-ext-configure intl && \
|
|
|
|
docker-php-ext-install intl \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
# GHOSTSCRIPT:
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
|
|
|
|
ARG INSTALL_GHOSTSCRIPT=false
|
2018-04-06 15:04:56 +08:00
|
|
|
|
2018-02-17 01:40:13 +08:00
|
|
|
RUN if [ ${INSTALL_GHOSTSCRIPT} = true ]; then \
|
|
|
|
# Install the ghostscript extension
|
|
|
|
# for PDF editing
|
2018-04-06 15:04:56 +08:00
|
|
|
apt-get install -y \
|
2018-02-17 01:40:13 +08:00
|
|
|
poppler-utils \
|
|
|
|
ghostscript \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
# LDAP:
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
|
|
|
|
ARG INSTALL_LDAP=false
|
2018-04-06 15:04:56 +08:00
|
|
|
|
2018-02-17 01:40:13 +08:00
|
|
|
RUN if [ ${INSTALL_LDAP} = true ]; then \
|
|
|
|
apt-get install -y libldap2-dev && \
|
|
|
|
docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ && \
|
|
|
|
docker-php-ext-install ldap \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
# SQL SERVER:
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
|
|
|
|
2018-02-17 01:40:13 +08:00
|
|
|
ARG INSTALL_MSSQL=false
|
2018-04-06 15:04:56 +08:00
|
|
|
|
2019-02-23 16:46:46 +08:00
|
|
|
RUN set -eux; \
|
|
|
|
if [ ${INSTALL_MSSQL} = true ]; then \
|
2018-06-11 14:23:40 +08:00
|
|
|
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
|
|
|
|
apt-get -y install freetds-dev libsybdb5 \
|
|
|
|
&& ln -s /usr/lib/x86_64-linux-gnu/libsybdb.so /usr/lib/libsybdb.so \
|
|
|
|
&& docker-php-ext-install mssql pdo_dblib \
|
|
|
|
&& php -m | grep -q 'mssql' \
|
|
|
|
&& php -m | grep -q 'pdo_dblib' \
|
|
|
|
;else \
|
|
|
|
###########################################################################
|
|
|
|
# Ref from https://github.com/Microsoft/msphpsql/wiki/Dockerfile-for-adding-pdo_sqlsrv-and-sqlsrv-to-official-php-image
|
|
|
|
###########################################################################
|
|
|
|
# Add Microsoft repo for Microsoft ODBC Driver 13 for Linux
|
|
|
|
apt-get install -y apt-transport-https gnupg \
|
|
|
|
&& curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
|
2018-07-28 15:08:01 +08:00
|
|
|
&& curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list \
|
2018-06-11 14:23:40 +08:00
|
|
|
&& apt-get update -yqq \
|
|
|
|
# Install Dependencies
|
2018-07-28 15:08:01 +08:00
|
|
|
&& ACCEPT_EULA=Y apt-get install -y unixodbc unixodbc-dev libgss3 odbcinst msodbcsql17 locales \
|
2018-06-11 14:23:40 +08:00
|
|
|
&& echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \
|
2018-07-28 15:08:01 +08:00
|
|
|
# link local aliases
|
2018-07-29 12:42:13 +08:00
|
|
|
&& ln -sfn /etc/locale.alias /usr/share/locale/locale.alias \
|
2018-06-11 14:23:40 +08:00
|
|
|
&& locale-gen \
|
|
|
|
# Install pdo_sqlsrv and sqlsrv from PECL. Replace pdo_sqlsrv-4.1.8preview with preferred version.
|
2019-02-22 23:45:21 +08:00
|
|
|
&& if [ $(php -r "echo PHP_MINOR_VERSION;") = "0" ]; then \
|
|
|
|
pecl install pdo_sqlsrv-5.3.0 sqlsrv-5.3.0 \
|
|
|
|
;else \
|
|
|
|
pecl install pdo_sqlsrv sqlsrv \
|
|
|
|
;fi \
|
2018-06-11 14:23:40 +08:00
|
|
|
&& docker-php-ext-enable pdo_sqlsrv sqlsrv \
|
|
|
|
&& php -m | grep -q 'pdo_sqlsrv' \
|
|
|
|
&& php -m | grep -q 'sqlsrv' \
|
|
|
|
;fi \
|
2019-02-23 16:46:46 +08:00
|
|
|
;fi
|
2018-02-17 01:40:13 +08:00
|
|
|
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
# Image optimizers:
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
|
|
|
|
2018-02-17 01:40:13 +08:00
|
|
|
USER root
|
2018-04-06 15:04:56 +08:00
|
|
|
|
2018-02-17 01:40:13 +08:00
|
|
|
ARG INSTALL_IMAGE_OPTIMIZERS=false
|
2018-04-06 15:04:56 +08:00
|
|
|
|
2018-02-17 01:40:13 +08:00
|
|
|
RUN if [ ${INSTALL_IMAGE_OPTIMIZERS} = true ]; then \
|
2018-06-24 23:19:49 +08:00
|
|
|
apt-get install -y jpegoptim optipng pngquant gifsicle \
|
2018-02-17 01:40:13 +08:00
|
|
|
;fi
|
|
|
|
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 01:40:13 +08:00
|
|
|
# ImageMagick:
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
|
|
|
|
2018-02-17 01:40:13 +08:00
|
|
|
USER root
|
2018-04-06 15:04:56 +08:00
|
|
|
|
2018-02-17 01:40:13 +08:00
|
|
|
ARG INSTALL_IMAGEMAGICK=false
|
2018-04-06 15:04:56 +08:00
|
|
|
|
2018-02-17 01:40:13 +08:00
|
|
|
RUN if [ ${INSTALL_IMAGEMAGICK} = true ]; then \
|
2018-02-24 04:27:04 +08:00
|
|
|
apt-get install -y libmagickwand-dev imagemagick && \
|
2018-02-17 01:40:13 +08:00
|
|
|
pecl install imagick && \
|
|
|
|
docker-php-ext-enable imagick \
|
|
|
|
;fi
|
|
|
|
|
2019-12-28 08:34:56 +08:00
|
|
|
###########################################################################
|
|
|
|
# SMB:
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
ARG INSTALL_SMB=false
|
|
|
|
|
|
|
|
RUN if [ ${INSTALL_SMB} = true ]; then \
|
|
|
|
apt-get install -y smbclient php-smbclient coreutils \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-26 21:27:56 +08:00
|
|
|
# IMAP:
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
|
|
|
|
2018-02-26 21:27:56 +08:00
|
|
|
ARG INSTALL_IMAP=false
|
2018-04-06 15:04:56 +08:00
|
|
|
|
2018-02-26 21:27:56 +08:00
|
|
|
RUN if [ ${INSTALL_IMAP} = true ]; then \
|
|
|
|
apt-get install -y libc-client-dev libkrb5-dev && \
|
|
|
|
docker-php-ext-configure imap --with-kerberos --with-imap-ssl && \
|
|
|
|
docker-php-ext-install imap \
|
|
|
|
;fi
|
|
|
|
|
2018-07-13 18:31:13 +08:00
|
|
|
###########################################################################
|
|
|
|
# Calendar:
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
USER root
|
|
|
|
|
|
|
|
ARG INSTALL_CALENDAR=false
|
|
|
|
|
|
|
|
RUN if [ ${INSTALL_CALENDAR} = true ]; then \
|
|
|
|
docker-php-ext-configure calendar && \
|
|
|
|
docker-php-ext-install calendar \
|
|
|
|
;fi
|
|
|
|
|
2018-09-22 15:45:41 +08:00
|
|
|
###########################################################################
|
|
|
|
# Phalcon:
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
ARG INSTALL_PHALCON=false
|
|
|
|
ARG LARADOCK_PHALCON_VERSION
|
|
|
|
ENV LARADOCK_PHALCON_VERSION ${LARADOCK_PHALCON_VERSION}
|
|
|
|
|
2019-01-10 21:50:59 +08:00
|
|
|
# Copy phalcon configration
|
|
|
|
COPY ./phalcon.ini /usr/local/etc/php/conf.d/phalcon.ini.disable
|
|
|
|
|
2018-09-22 15:45:41 +08:00
|
|
|
RUN if [ $INSTALL_PHALCON = true ]; then \
|
|
|
|
apt-get update && apt-get install -y unzip libpcre3-dev gcc make re2c \
|
|
|
|
&& curl -L -o /tmp/cphalcon.zip https://github.com/phalcon/cphalcon/archive/v${LARADOCK_PHALCON_VERSION}.zip \
|
|
|
|
&& unzip -d /tmp/ /tmp/cphalcon.zip \
|
|
|
|
&& cd /tmp/cphalcon-${LARADOCK_PHALCON_VERSION}/build \
|
|
|
|
&& ./install \
|
2019-01-10 21:50:59 +08:00
|
|
|
&& mv /usr/local/etc/php/conf.d/phalcon.ini.disable /usr/local/etc/php/conf.d/phalcon.ini \
|
2018-09-22 15:45:41 +08:00
|
|
|
&& rm -rf /tmp/cphalcon* \
|
|
|
|
;fi
|
|
|
|
|
2019-01-08 15:30:12 +08:00
|
|
|
###########################################################################
|
|
|
|
# APCU:
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
ARG INSTALL_APCU=false
|
|
|
|
|
|
|
|
RUN if [ ${INSTALL_APCU} = true ]; then \
|
2019-02-09 16:33:06 +08:00
|
|
|
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
|
|
|
|
pecl install -a apcu-4.0.11; \
|
|
|
|
else \
|
|
|
|
pecl install apcu; \
|
|
|
|
fi && \
|
2019-01-08 15:30:12 +08:00
|
|
|
docker-php-ext-enable apcu \
|
2019-01-09 21:22:42 +08:00
|
|
|
;fi
|
2019-01-08 15:30:12 +08:00
|
|
|
|
2018-11-22 08:12:52 +08:00
|
|
|
###########################################################################
|
|
|
|
# YAML:
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
USER root
|
|
|
|
|
|
|
|
ARG INSTALL_YAML=false
|
|
|
|
|
|
|
|
RUN if [ ${INSTALL_YAML} = true ]; then \
|
|
|
|
apt-get install libyaml-dev -y ; \
|
2019-02-09 16:33:06 +08:00
|
|
|
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
|
|
|
|
pecl install -a yaml-1.3.2; \
|
|
|
|
else \
|
|
|
|
pecl install yaml; \
|
|
|
|
fi && \
|
2018-11-22 08:12:52 +08:00
|
|
|
docker-php-ext-enable yaml \
|
|
|
|
;fi
|
|
|
|
|
2019-05-08 18:15:09 +08:00
|
|
|
###########################################################################
|
|
|
|
# RDKAFKA:
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
ARG INSTALL_RDKAFKA=false
|
|
|
|
|
|
|
|
RUN if [ ${INSTALL_RDKAFKA} = true ]; then \
|
|
|
|
apt-get install -y librdkafka-dev && \
|
|
|
|
pecl install rdkafka && \
|
|
|
|
docker-php-ext-enable rdkafka \
|
|
|
|
;fi
|
|
|
|
|
2019-02-14 21:52:40 +08:00
|
|
|
###########################################################################
|
2019-10-09 03:35:55 +08:00
|
|
|
# GETTEXT:
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
ARG INSTALL_GETTEXT=false
|
|
|
|
|
|
|
|
RUN if [ ${INSTALL_GETTEXT} = true ]; then \
|
|
|
|
apt-get install -y zlib1g-dev libicu-dev g++ libpq-dev libssl-dev gettext && \
|
|
|
|
docker-php-ext-install gettext \
|
|
|
|
;fi
|
|
|
|
|
2019-02-14 21:52:40 +08:00
|
|
|
###########################################################################
|
|
|
|
# Install additional locales:
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
ARG INSTALL_ADDITIONAL_LOCALES=false
|
|
|
|
ARG ADDITIONAL_LOCALES
|
|
|
|
|
|
|
|
RUN if [ ${INSTALL_ADDITIONAL_LOCALES} = true ]; then \
|
|
|
|
apt-get install -y locales \
|
|
|
|
&& echo '' >> /usr/share/locale/locale.alias \
|
|
|
|
&& temp="${ADDITIONAL_LOCALES%\"}" \
|
|
|
|
&& temp="${temp#\"}" \
|
|
|
|
&& for i in ${temp}; do sed -i "/$i/s/^#//g" /etc/locale.gen; done \
|
|
|
|
&& locale-gen \
|
|
|
|
;fi
|
|
|
|
|
2019-02-22 18:30:05 +08:00
|
|
|
###########################################################################
|
|
|
|
# MySQL Client:
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
USER root
|
|
|
|
|
|
|
|
ARG INSTALL_MYSQL_CLIENT=false
|
|
|
|
|
|
|
|
RUN if [ ${INSTALL_MYSQL_CLIENT} = true ]; then \
|
2019-10-26 00:15:40 +08:00
|
|
|
apt-get -y install default-mysql-client \
|
2019-05-08 22:27:39 +08:00
|
|
|
;fi
|
|
|
|
|
2019-06-06 11:59:13 +08:00
|
|
|
###########################################################################
|
|
|
|
# ping:
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
USER root
|
|
|
|
|
|
|
|
ARG INSTALL_PING=false
|
|
|
|
|
|
|
|
RUN if [ ${INSTALL_PING} = true ]; then \
|
|
|
|
apt-get -y install inetutils-ping \
|
|
|
|
;fi
|
|
|
|
|
|
|
|
###########################################################################
|
|
|
|
# sshpass:
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
USER root
|
|
|
|
|
|
|
|
ARG INSTALL_SSHPASS=false
|
|
|
|
|
|
|
|
RUN if [ ${INSTALL_SSHPASS} = true ]; then \
|
|
|
|
apt-get -y install sshpass \
|
|
|
|
;fi
|
|
|
|
|
2019-05-08 22:27:39 +08:00
|
|
|
###########################################################################
|
|
|
|
# FFMPEG:
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
USER root
|
|
|
|
|
|
|
|
ARG INSTALL_FFMPEG=false
|
|
|
|
|
|
|
|
RUN if [ ${INSTALL_FFMPEG} = true ]; then \
|
|
|
|
apt-get -y install ffmpeg \
|
2019-07-02 22:11:58 +08:00
|
|
|
;fi
|
|
|
|
|
2020-01-16 01:01:35 +08:00
|
|
|
#####################################
|
|
|
|
# wkhtmltopdf:
|
|
|
|
#####################################
|
|
|
|
|
|
|
|
USER root
|
|
|
|
|
|
|
|
ARG INSTALL_WKHTMLTOPDF=false
|
|
|
|
|
|
|
|
RUN if [ ${INSTALL_WKHTMLTOPDF} = true ]; then \
|
|
|
|
apt-get install -y \
|
|
|
|
libxrender1 \
|
|
|
|
libfontconfig1 \
|
|
|
|
libx11-dev \
|
|
|
|
libjpeg62 \
|
|
|
|
libxtst6 \
|
|
|
|
wget \
|
|
|
|
&& wget https://github.com/h4cc/wkhtmltopdf-amd64/blob/master/bin/wkhtmltopdf-amd64?raw=true -O /usr/local/bin/wkhtmltopdf \
|
|
|
|
&& chmod +x /usr/local/bin/wkhtmltopdf \
|
|
|
|
;fi
|
|
|
|
|
2019-07-02 22:11:58 +08:00
|
|
|
###########################################################################
|
|
|
|
# Mailparse extension:
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
ARG INSTALL_MAILPARSE=false
|
|
|
|
|
|
|
|
RUN if [ ${INSTALL_MAILPARSE} = true ]; then \
|
|
|
|
# Install mailparse extension
|
|
|
|
printf "\n" | pecl install -o -f mailparse \
|
|
|
|
&& rm -rf /tmp/pear \
|
|
|
|
&& docker-php-ext-enable mailparse \
|
2019-02-22 18:30:05 +08:00
|
|
|
;fi
|
|
|
|
|
2019-12-03 18:53:42 +08:00
|
|
|
###########################################################################
|
|
|
|
# CacheTool:
|
|
|
|
###########################################################################
|
|
|
|
|
|
|
|
ARG INSTALL_CACHETOOL=false
|
|
|
|
|
|
|
|
RUN if [ ${INSTALL_CACHETOOL} = true ]; then \
|
|
|
|
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ] && [ $(php -r "echo PHP_MINOR_VERSION;") -ge 1 ]; then \
|
|
|
|
curl -sO http://gordalina.github.io/cachetool/downloads/cachetool.phar; \
|
|
|
|
else \
|
|
|
|
curl http://gordalina.github.io/cachetool/downloads/cachetool-3.2.1.phar -o cachetool.phar; \
|
|
|
|
fi && \
|
|
|
|
chmod +x cachetool.phar && \
|
|
|
|
mv cachetool.phar /usr/local/bin/cachetool \
|
|
|
|
;fi
|
|
|
|
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
2018-02-17 16:26:46 +08:00
|
|
|
# Check PHP version:
|
2018-04-06 15:04:56 +08:00
|
|
|
###########################################################################
|
|
|
|
|
2019-02-23 16:46:46 +08:00
|
|
|
RUN set -xe; php -v | head -n 1 | grep -q "PHP ${LARADOCK_PHP_VERSION}."
|
2018-02-17 16:26:46 +08:00
|
|
|
|
2018-02-17 01:40:13 +08:00
|
|
|
#
|
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
# Final Touch
|
|
|
|
#--------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
|
2018-04-04 20:13:11 +08:00
|
|
|
COPY ./laravel.ini /usr/local/etc/php/conf.d
|
|
|
|
COPY ./xlaravel.pool.conf /usr/local/etc/php-fpm.d/
|
2018-02-17 01:40:13 +08:00
|
|
|
|
2018-04-06 15:04:56 +08:00
|
|
|
USER root
|
|
|
|
|
|
|
|
# Clean up
|
|
|
|
RUN apt-get clean && \
|
|
|
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
|
|
|
|
rm /var/log/lastlog /var/log/faillog
|
2018-02-17 01:40:13 +08:00
|
|
|
|
2019-10-01 07:08:09 +08:00
|
|
|
# Configure non-root user.
|
|
|
|
ARG PUID=1000
|
|
|
|
ENV PUID ${PUID}
|
|
|
|
ARG PGID=1000
|
|
|
|
ENV PGID ${PGID}
|
|
|
|
|
|
|
|
RUN groupmod -o -g ${PGID} www-data && \
|
|
|
|
usermod -o -u ${PUID} -g www-data www-data
|
2018-02-17 01:40:13 +08:00
|
|
|
|
2018-08-21 13:41:34 +08:00
|
|
|
# Adding the faketime library to the preload file needs to be done last
|
|
|
|
# otherwise it will preload it for all commands that follow in this file
|
|
|
|
RUN if [ ${INSTALL_FAKETIME} = true ]; then \
|
|
|
|
echo "/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1" > /etc/ld.so.preload \
|
|
|
|
;fi
|
|
|
|
|
2019-12-11 14:28:14 +08:00
|
|
|
# Configure locale.
|
|
|
|
ARG LOCALE=POSIX
|
|
|
|
ENV LC_ALL ${LOCALE}
|
|
|
|
|
2018-02-17 01:40:13 +08:00
|
|
|
WORKDIR /var/www
|
|
|
|
|
|
|
|
CMD ["php-fpm"]
|
|
|
|
|
|
|
|
EXPOSE 9000
|