diff --git a/php-fpm/Dockerfile-56 b/php-fpm/Dockerfile-56 index 4fd449a..3290ff1 100644 --- a/php-fpm/Dockerfile-56 +++ b/php-fpm/Dockerfile-56 @@ -302,11 +302,11 @@ RUN if [ ${INSTALL_LDAP} = true ]; then \ ##################################### ARG INSTALL_MSSQL=false ENV INSTALL_MSSQL ${INSTALL_MSSQL} - -RUN if [ ${INSTALL_MSSQL} = true ]; then \ - apt-get -y install php5-sybase freetds-bin && \ - cp /usr/lib/php5/20131226/*.so /usr/local/lib/php/extensions/no-debug-non-zts-20131226/ && \ - docker-php-ext-enable mssql pdo pdo_dblib \ +RUN set -eux; if [ ${INSTALL_MSSQL} = true ]; then \ + apt-get -y install php5-sybase freetds-bin \ + && cp /usr/lib/php5/20131226/*.so /usr/local/lib/php/extensions/no-debug-non-zts-20131226/ \ + && docker-php-ext-enable pdo_dblib mssql \ + && php -m | grep -q 'mssql' \ ;fi ##################################### diff --git a/php-fpm/Dockerfile-70 b/php-fpm/Dockerfile-70 index b1d045e..281a64f 100644 --- a/php-fpm/Dockerfile-70 +++ b/php-fpm/Dockerfile-70 @@ -308,26 +308,27 @@ RUN if [ ${INSTALL_LDAP} = true ]; then \ ##################################### # SQL SERVER: ##################################### - ARG INSTALL_MSSQL=false 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 ##################################### # Add Microsoft repo for Microsoft ODBC Driver 13 for Linux 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/config/debian/8/prod.list > /etc/apt/sources.list.d/mssql-release.list \ - && 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/config/debian/8/prod.list > /etc/apt/sources.list.d/mssql-release.list \ + && apt-get update -yqq \ # Install Dependencies - && 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 \ + && 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 \ # 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 \ - && docker-php-ext-enable pdo_sqlsrv sqlsrv \ + && pecl install pdo_sqlsrv-4.1.8preview sqlsrv-4.1.8preview \ + && docker-php-ext-enable pdo_sqlsrv sqlsrv \ + && php -m | grep -q 'pdo_sqlsrv' \ + && php -m | grep -q 'sqlsrv' \ ;fi ##################################### diff --git a/php-fpm/Dockerfile-71 b/php-fpm/Dockerfile-71 index 78b7e53..d87584c 100644 --- a/php-fpm/Dockerfile-71 +++ b/php-fpm/Dockerfile-71 @@ -308,24 +308,27 @@ RUN if [ ${INSTALL_LDAP} = true ]; then \ ##################################### # SQL SERVER: ##################################### - ARG INSTALL_MSSQL=false 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 ##################################### # Add Microsoft repo for Microsoft ODBC Driver 13 for Linux - 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/config/debian/8/prod.list > /etc/apt/sources.list.d/mssql-release.list \ - && apt-get update -yqq \ + 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/config/debian/8/prod.list > /etc/apt/sources.list.d/mssql-release.list \ + && apt-get update -yqq \ # Install Dependencies - && 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 \ + && 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 \ # 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 \ - && docker-php-ext-enable pdo_sqlsrv sqlsrv \ + && pecl install pdo_sqlsrv-4.1.8preview sqlsrv-4.1.8preview \ + && docker-php-ext-enable pdo_sqlsrv sqlsrv \ + && php -m | grep -q 'pdo_sqlsrv' \ + && php -m | grep -q 'sqlsrv' \ ;fi ##################################### diff --git a/php-fpm/Dockerfile-72 b/php-fpm/Dockerfile-72 index 073af76..c9ea138 100644 --- a/php-fpm/Dockerfile-72 +++ b/php-fpm/Dockerfile-72 @@ -311,26 +311,27 @@ RUN if [ ${INSTALL_LDAP} = true ]; then \ ##################################### # SQL SERVER: ##################################### - ARG INSTALL_MSSQL=false 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 ##################################### # Add Microsoft repo for Microsoft ODBC Driver 13 for Linux - 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/config/debian/8/prod.list > /etc/apt/sources.list.d/mssql-release.list \ - && apt-get update -yqq \ - + 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/config/debian/8/prod.list > /etc/apt/sources.list.d/mssql-release.list \ + && apt-get update -yqq \ # Install Dependencies - && 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 \ - + && 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 \ # 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 \ - && docker-php-ext-enable pdo_sqlsrv sqlsrv \ + && pecl install pdo_sqlsrv-4.1.8preview sqlsrv-4.1.8preview \ + && docker-php-ext-enable pdo_sqlsrv sqlsrv \ + && php -m | grep -q 'pdo_sqlsrv' \ + && php -m | grep -q 'sqlsrv' \ ;fi #####################################