Created
November 26, 2019 22:44
-
-
Save paulrobello/7bc8afe3ea07d5be88cbe902f100ff0f to your computer and use it in GitHub Desktop.
Custom apache php dev with added mssql pdo driver Dockerfile
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 webdevops/php-apache-dev:7.2 | |
# add microsoft packages to apt sources | |
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - | |
RUN curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list | |
# install needed system packages as well as a few nice to have utils | |
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ | |
DEBIAN_FRONTEND=noninteractive apt-get -y upgrade && \ | |
ACCEPT_EULA=Y apt-get -y install msodbcsql17 unixodbc-dev less joe iputils-ping traceroute telnet && \ | |
apt-get purge -y --auto-remove && \ | |
rm -rf /var/lib/apt/lists/* | |
# install sqlsrv php extensions | |
RUN pecl install sqlsrv pdo_sqlsrv | |
# load the pdo extension | |
RUN echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini | |
# load the mssql extension | |
RUN echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.ini | |
# our docroot | |
WORKDIR /app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment