Merge branch 'master' into fix_xhprof_version

This commit is contained in:
Shao Yu-Lung (Allen)
2019-12-06 19:44:45 +08:00
committed by GitHub
20 changed files with 411 additions and 37 deletions

View File

@ -14,7 +14,7 @@
ARG LARADOCK_PHP_VERSION
FROM laradock/php-fpm:2.5-${LARADOCK_PHP_VERSION}
FROM laradock/php-fpm:2.6.1-${LARADOCK_PHP_VERSION}
LABEL maintainer="Mahmoud Zalt <mahmoud@zalt.me>"
@ -23,10 +23,14 @@ ARG LARADOCK_PHP_VERSION
# Set Environment Variables
ENV DEBIAN_FRONTEND noninteractive
# If you're in China, or you need to change sources, will be set CHANGE_SOURCE to true in .env.
ARG CHANGE_SOURCE=false
RUN if [ ${CHANGE_SOURCE} = true ]; then \
# Change application source from deb.debian.org to aliyun source
sed -i 's/deb.debian.org/mirrors.aliyun.com/' /etc/apt/sources.list \
sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/' /etc/apt/sources.list && \
sed -i 's/security.debian.org/mirrors.tuna.tsinghua.edu.cn/' /etc/apt/sources.list && \
sed -i 's/security-cdn.debian.org/mirrors.tuna.tsinghua.edu.cn/' /etc/apt/sources.list \
;fi
# always run apt update when start and after add new source list, then clean up at end.
@ -270,7 +274,7 @@ RUN if [ ${INSTALL_MONGO} = true ]; then \
ARG INSTALL_XHPROF=false
RUN if [ ${INSTALL_XHPROF} = true ]; then \
# Install the php xhprof extension
# Install the php xhprof extension
if [ $(php -r "echo PHP_MAJOR_VERSION;") = 7 ]; then \
curl -L -o /tmp/xhprof.tar.gz "https://github.com/tideways/php-xhprof-extension/archive/v5.0.1.tar.gz"; \
else \
@ -682,6 +686,17 @@ RUN if [ ${INSTALL_RDKAFKA} = true ]; then \
docker-php-ext-enable rdkafka \
;fi
###########################################################################
# 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
###########################################################################
# Install additional locales:
###########################################################################
@ -708,7 +723,11 @@ ARG INSTALL_MYSQL_CLIENT=false
RUN if [ ${INSTALL_MYSQL_CLIENT} = true ]; then \
apt-get update -yqq && \
apt-get -y install mysql-client \
if [ ${LARADOCK_PHP_VERSION} = "7.3" ]; then \
apt-get -y install default-mysql-client \
;else \
apt-get -y install mysql-client \
;fi \
;fi
###########################################################################
@ -763,6 +782,22 @@ RUN if [ ${INSTALL_MAILPARSE} = true ]; then \
&& docker-php-ext-enable mailparse \
;fi
###########################################################################
# 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
###########################################################################
# Check PHP version:
###########################################################################
@ -785,7 +820,14 @@ RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
rm /var/log/lastlog /var/log/faillog
RUN usermod -u 1000 www-data
# 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
# 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