Last active
January 20, 2020 14:38
-
-
Save danielnv18/7e1c680bfd1fc48e4c2cc5a180dff1b7 to your computer and use it in GitHub Desktop.
Docker with php 7.3 with unixodbc, Microsoft ODBC Driver 17 for Linux and pdo_sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:7.3-fpm | |
MAINTAINER Daniel Noyola <[email protected]> | |
# Install Dependencies | |
RUN apt-get update && apt-get install -y locales unixodbc libgss3 odbcinst \ | |
devscripts debhelper dh-exec dh-autoreconf libreadline-dev libltdl-dev \ | |
unixodbc-dev wget unzip \ | |
&& rm -rf /var/lib/apt/lists/* \ | |
&& docker-php-ext-install pdo \ | |
&& echo "en_US.UTF-8 UTF-8" > /etc/locale.gen | |
# Add Microsoft repo for Microsoft ODBC Driver 17 for Linux | |
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \ | |
&& curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list | |
RUN apt-get update && ACCEPT_EULA=Y apt-get install -y \ | |
apt-transport-https \ | |
msodbcsql17 | |
# Enable the php extensions. | |
RUN pecl install pdo_sqlsrv-5.6.1 sqlsrv-5.6.1 \ | |
&& docker-php-ext-enable pdo_sqlsrv sqlsrv | |
CMD ["php-fpm", "-F"] | |
EXPOSE 9000 |
As @BlueM mentioned
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
&& curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list
# Add Microsoft repo for Microsoft ODBC Driver 17 for Linux
RUN apt-get update && ACCEPT_EULA=Y apt-get install -y \
apt-transport-https \
msodbcsql17
Updated!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Lines 14 ff. do not work in this order: you first have to add the apt sources, then update apt before you can install
msodbcsql17
.