Optimize php-fpm and workspace Dockerfile. (#2015)

This commit is contained in:
Shao Yu-Lung (Allen)
2019-02-23 16:46:46 +08:00
committed by GitHub
parent cde20c3ced
commit 61d7b18922
2 changed files with 61 additions and 62 deletions

View File

@ -24,27 +24,27 @@ ARG LARADOCK_PHP_VERSION
ENV DEBIAN_FRONTEND noninteractive
# always run apt update when start and after add new source list, then clean up at end.
RUN set -xe && apt-get update -yqq && \
apt-get install -y apt-utils && \
pecl channel-update pecl.php.net
#
#--------------------------------------------------------------------------
# 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
USER root
RUN apt-get install libzip-dev zip unzip -y && \
docker-php-ext-configure zip --with-libzip && \
# Install the zip extension
docker-php-ext-install zip
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 && \
docker-php-ext-configure zip --with-libzip && \
# Install the zip extension
docker-php-ext-install zip && \
php -m | grep -q 'zip'
#
#--------------------------------------------------------------------------
@ -340,7 +340,8 @@ USER root
ARG INSTALL_AEROSPIKE=false
RUN set -xe && if [ ${INSTALL_AEROSPIKE} = true ]; then \
RUN set -xe; \
if [ ${INSTALL_AEROSPIKE} = true ]; then \
# Fix dependencies for PHPUnit within aerospike extension
apt-get -y install sudo wget && \
# Install the php aerospike extension
@ -455,7 +456,8 @@ RUN if [ ${INSTALL_LDAP} = true ]; then \
ARG INSTALL_MSSQL=false
RUN set -eux; if [ ${INSTALL_MSSQL} = true ]; then \
RUN set -eux; \
if [ ${INSTALL_MSSQL} = true ]; then \
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 \
@ -487,7 +489,7 @@ RUN set -eux; if [ ${INSTALL_MSSQL} = true ]; then \
&& php -m | grep -q 'pdo_sqlsrv' \
&& php -m | grep -q 'sqlsrv' \
;fi \
;fi
;fi
###########################################################################
# Image optimizers:
@ -628,7 +630,7 @@ RUN if [ ${INSTALL_MYSQL_CLIENT} = true ]; then \
# Check PHP version:
###########################################################################
RUN php -v | head -n 1 | grep -q "PHP ${LARADOCK_PHP_VERSION}."
RUN set -xe; php -v | head -n 1 | grep -q "PHP ${LARADOCK_PHP_VERSION}."
#
#--------------------------------------------------------------------------