php-fpm sql server section: increase install check

This commit is contained in:
Shao Yu Lung 2018-03-24 13:56:06 +08:00
parent 21a5d5bf98
commit cd849dda21
4 changed files with 43 additions and 38 deletions

View File

@ -302,11 +302,11 @@ RUN if [ ${INSTALL_LDAP} = true ]; then \
##################################### #####################################
ARG INSTALL_MSSQL=false ARG INSTALL_MSSQL=false
ENV INSTALL_MSSQL ${INSTALL_MSSQL} ENV INSTALL_MSSQL ${INSTALL_MSSQL}
RUN set -eux; if [ ${INSTALL_MSSQL} = true ]; then \
RUN if [ ${INSTALL_MSSQL} = true ]; then \ apt-get -y install php5-sybase freetds-bin \
apt-get -y install php5-sybase freetds-bin && \ && cp /usr/lib/php5/20131226/*.so /usr/local/lib/php/extensions/no-debug-non-zts-20131226/ \
cp /usr/lib/php5/20131226/*.so /usr/local/lib/php/extensions/no-debug-non-zts-20131226/ && \ && docker-php-ext-enable pdo_dblib mssql \
docker-php-ext-enable mssql pdo pdo_dblib \ && php -m | grep -q 'mssql' \
;fi ;fi
##################################### #####################################

View File

@ -308,10 +308,9 @@ RUN if [ ${INSTALL_LDAP} = true ]; then \
##################################### #####################################
# SQL SERVER: # SQL SERVER:
##################################### #####################################
ARG INSTALL_MSSQL=false ARG INSTALL_MSSQL=false
ENV INSTALL_MSSQL ${INSTALL_MSSQL} ENV INSTALL_MSSQL ${INSTALL_MSSQL}
RUN if [ ${INSTALL_MSSQL} = true ]; then \ RUN set -eux; if [ ${INSTALL_MSSQL} = true ]; then \
##################################### #####################################
# Ref from https://github.com/Microsoft/msphpsql/wiki/Dockerfile-for-adding-pdo_sqlsrv-and-sqlsrv-to-official-php-image # Ref from https://github.com/Microsoft/msphpsql/wiki/Dockerfile-for-adding-pdo_sqlsrv-and-sqlsrv-to-official-php-image
##################################### #####################################
@ -328,6 +327,8 @@ RUN if [ ${INSTALL_MSSQL} = true ]; then \
# Install pdo_sqlsrv and sqlsrv from PECL. Replace pdo_sqlsrv-4.1.8preview with preferred version. # Install pdo_sqlsrv and sqlsrv from PECL. Replace pdo_sqlsrv-4.1.8preview with preferred version.
&& pecl install pdo_sqlsrv-4.1.8preview sqlsrv-4.1.8preview \ && pecl install pdo_sqlsrv-4.1.8preview sqlsrv-4.1.8preview \
&& docker-php-ext-enable pdo_sqlsrv sqlsrv \ && docker-php-ext-enable pdo_sqlsrv sqlsrv \
&& php -m | grep -q 'pdo_sqlsrv' \
&& php -m | grep -q 'sqlsrv' \
;fi ;fi
##################################### #####################################

View File

@ -308,24 +308,27 @@ RUN if [ ${INSTALL_LDAP} = true ]; then \
##################################### #####################################
# SQL SERVER: # SQL SERVER:
##################################### #####################################
ARG INSTALL_MSSQL=false ARG INSTALL_MSSQL=false
ENV INSTALL_MSSQL ${INSTALL_MSSQL} ENV INSTALL_MSSQL ${INSTALL_MSSQL}
RUN if [ ${INSTALL_MSSQL} = true ]; then \ RUN set -eux; if [ ${INSTALL_MSSQL} = true ]; then \
##################################### #####################################
# Ref from https://github.com/Microsoft/msphpsql/wiki/Dockerfile-for-adding-pdo_sqlsrv-and-sqlsrv-to-official-php-image # 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 # Add Microsoft repo for Microsoft ODBC Driver 13 for Linux
apt-get update -yqq && apt-get install -y apt-transport-https \ apt-get update -yqq \
&& apt-get install -y apt-transport-https \
&& curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \ && curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
&& curl https://packages.microsoft.com/config/debian/8/prod.list > /etc/apt/sources.list.d/mssql-release.list \ && curl https://packages.microsoft.com/config/debian/8/prod.list > /etc/apt/sources.list.d/mssql-release.list \
&& apt-get update -yqq \ && apt-get update -yqq \
# Install Dependencies # Install Dependencies
&& ACCEPT_EULA=Y apt-get install -y unixodbc unixodbc-dev libgss3 odbcinst msodbcsql locales \ && ACCEPT_EULA=Y apt-get install -y unixodbc unixodbc-dev libgss3 odbcinst msodbcsql locales \
&& echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen \ && echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \
&& locale-gen \
# Install pdo_sqlsrv and sqlsrv from PECL. Replace pdo_sqlsrv-4.1.8preview with preferred version. # Install pdo_sqlsrv and sqlsrv from PECL. Replace pdo_sqlsrv-4.1.8preview with preferred version.
&& pecl install pdo_sqlsrv-4.1.8preview sqlsrv-4.1.8preview \ && pecl install pdo_sqlsrv-4.1.8preview sqlsrv-4.1.8preview \
&& docker-php-ext-enable pdo_sqlsrv sqlsrv \ && docker-php-ext-enable pdo_sqlsrv sqlsrv \
&& php -m | grep -q 'pdo_sqlsrv' \
&& php -m | grep -q 'sqlsrv' \
;fi ;fi
##################################### #####################################

View File

@ -311,26 +311,27 @@ RUN if [ ${INSTALL_LDAP} = true ]; then \
##################################### #####################################
# SQL SERVER: # SQL SERVER:
##################################### #####################################
ARG INSTALL_MSSQL=false ARG INSTALL_MSSQL=false
ENV INSTALL_MSSQL ${INSTALL_MSSQL} ENV INSTALL_MSSQL ${INSTALL_MSSQL}
RUN if [ ${INSTALL_MSSQL} = true ]; then \ RUN set -eux; if [ ${INSTALL_MSSQL} = true ]; then \
##################################### #####################################
# Ref from https://github.com/Microsoft/msphpsql/wiki/Dockerfile-for-adding-pdo_sqlsrv-and-sqlsrv-to-official-php-image # 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 # Add Microsoft repo for Microsoft ODBC Driver 13 for Linux
apt-get update -yqq && apt-get install -y apt-transport-https gnupg \ apt-get update -yqq \
&& apt-get install -y apt-transport-https gnupg \
&& curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \ && curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
&& curl https://packages.microsoft.com/config/debian/8/prod.list > /etc/apt/sources.list.d/mssql-release.list \ && curl https://packages.microsoft.com/config/debian/8/prod.list > /etc/apt/sources.list.d/mssql-release.list \
&& apt-get update -yqq \ && apt-get update -yqq \
# Install Dependencies # Install Dependencies
&& ACCEPT_EULA=Y apt-get install -y unixodbc unixodbc-dev libgss3 odbcinst msodbcsql locales \ && ACCEPT_EULA=Y apt-get install -y unixodbc unixodbc-dev libgss3 odbcinst msodbcsql locales \
&& echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen \ && echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \
&& locale-gen \
# Install pdo_sqlsrv and sqlsrv from PECL. Replace pdo_sqlsrv-4.1.8preview with preferred version. # Install pdo_sqlsrv and sqlsrv from PECL. Replace pdo_sqlsrv-4.1.8preview with preferred version.
&& pecl install pdo_sqlsrv-4.1.8preview sqlsrv-4.1.8preview \ && pecl install pdo_sqlsrv-4.1.8preview sqlsrv-4.1.8preview \
&& docker-php-ext-enable pdo_sqlsrv sqlsrv \ && docker-php-ext-enable pdo_sqlsrv sqlsrv \
&& php -m | grep -q 'pdo_sqlsrv' \
&& php -m | grep -q 'sqlsrv' \
;fi ;fi
##################################### #####################################