Skip to content

Instantly share code, notes, and snippets.

Last active Jan 20, 2020
What would you like to do?
Docker with php 7.3 with unixodbc, Microsoft ODBC Driver 17 for Linux and pdo_sql
FROM php:7.3-fpm
MAINTAINER Daniel Noyola <>
# 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 | apt-key add - \
&& curl > /etc/apt/sources.list.d/mssql-release.list
RUN apt-get update && ACCEPT_EULA=Y apt-get install -y \
apt-transport-https \
# 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"]
Copy link


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment