From 1acbebc2a3fd90859953799a95e98cd9efea3ea3 Mon Sep 17 00:00:00 2001 From: Alex Mayer Date: Sat, 28 Jul 2018 03:08:01 -0400 Subject: [PATCH] Update MSSQL Drivers To Newest Version (#1707) Remove version lock from pecl install Update to Debian 9 repos since our image is Debian 9 Remove duplicate locales-gen line Closes #1622 --- php-fpm/Dockerfile | 8 +++++--- workspace/Dockerfile | 19 ++++--------------- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index 8a76ab75..5dc801ff 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -416,14 +416,16 @@ RUN set -eux; if [ ${INSTALL_MSSQL} = true ]; then \ # 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 - \ - && 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/9/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 \ + && ACCEPT_EULA=Y apt-get install -y unixodbc unixodbc-dev libgss3 odbcinst msodbcsql17 locales \ && echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \ + # link local aliases + && ln -s /etc/locale.alias /usr/share/locale/locale.alias \ && 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 \ + && pecl install pdo_sqlsrv sqlsrv \ && docker-php-ext-enable pdo_sqlsrv sqlsrv \ && php -m | grep -q 'pdo_sqlsrv' \ && php -m | grep -q 'sqlsrv' \ diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 0c885807..1921bac5 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -641,23 +641,12 @@ RUN set -eux; if [ ${INSTALL_MSSQL} = true ]; then \ curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \ curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-release.list && \ apt-get update -yqq && \ - ACCEPT_EULA=Y apt-get install -yqq msodbcsql=13.0.1.0-1 mssql-tools=14.0.2.0-1 && \ - apt-get install -yqq unixodbc-dev-utf16 && \ - ln -sfn /opt/mssql-tools/bin/sqlcmd-13.0.1.0 /usr/bin/sqlcmd && \ - ln -sfn /opt/mssql-tools/bin/bcp-13.0.1.0 /usr/bin/bcp && \ - ACCEPT_EULA=Y apt-get install -yqq \ - unixodbc \ - unixodbc-dev \ - libgss3 \ - odbcinst \ - msodbcsql \ - locales && \ - echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \ - locale-gen && \ - pecl install sqlsrv-4.3.0 pdo_sqlsrv-4.3.0 && \ - apt-get install -y locales && \ + ACCEPT_EULA=Y apt-get install -y msodbcsql17 mssql-tools unixodbc unixodbc-dev libgss3 odbcinst locales && \ + ln -sfn /opt/mssql-tools/bin/sqlcmd /usr/bin/sqlcmd && \ + ln -sfn /opt/mssql-tools/bin/bcp /usr/bin/bcp && \ echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \ locale-gen && \ + pecl install sqlsrv pdo_sqlsrv && \ echo "extension=sqlsrv.so" > /etc/php/${PHP_VERSION}/cli/conf.d/20-sqlsrv.ini && \ echo "extension=pdo_sqlsrv.so" > /etc/php/${PHP_VERSION}/cli/conf.d/20-pdo_sqlsrv.ini \ && php -m | grep -q 'sqlsrv' \