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
This commit is contained in:
Alex Mayer 2018-07-28 03:08:01 -04:00 committed by Shao Yu-Lung (Allen)
parent b2ab970d04
commit 1acbebc2a3
2 changed files with 9 additions and 18 deletions

View File

@ -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' \

View File

@ -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' \