Created
October 30, 2018 06:32
-
-
Save xenogew/3440d323b00e1d661966f2b2ca3ef64a to your computer and use it in GitHub Desktop.
Example of PHP 7.2.x Docker image install with MS SQL Server extensions
This file contains hidden or 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.2.11-fpm | |
WORKDIR /application | |
ENV ACCEPT_EULA=Y | |
# Fix debconf warnings upon build | |
ARG DEBIAN_FRONTEND=noninteractive | |
# Install selected extensions and other stuff | |
RUN apt-get update \ | |
&& apt-get -y --no-install-recommends install apt-utils libxml2-dev gnupg apt-transport-https \ | |
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* | |
# Install git | |
RUN apt-get update \ | |
&& apt-get -y install git \ | |
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* | |
# Install MS ODBC Driver for SQL Server | |
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 \ | |
&& apt-get update \ | |
&& apt-get -y --no-install-recommends install msodbcsql17 unixodbc-dev \ | |
&& pecl install sqlsrv \ | |
&& pecl install pdo_sqlsrv \ | |
&& echo "extension=pdo_sqlsrv.so" >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini \ | |
&& echo "extension=sqlsrv.so" >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-sqlsrv.ini \ | |
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/* | |
# Install required extensions | |
RUN docker-php-ext-install intl mysqli pdo pdo_mysql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Upgrade to actual versions