Last active
March 19, 2021 18:47
-
-
Save peter279k/4e34947ff6dddd3377c0056163ea8495 to your computer and use it in GitHub Desktop.
This is Docker image about the PHP+MSSQL enviroment
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
# Install required packages | |
# MySQL to MSSQL http://www.sqlines.com/online | |
FROM ubuntu:16.04 | |
RUN apt-get update | |
RUN apt-get install -y software-properties-common | |
RUN apt-get install -y python-software-properties | |
RUN LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php | |
RUN apt-get update | |
RUN apt-get install -y apt-transport-https apt-utils curl php7.1-cli php7.1-mysql php7.1-curl | |
RUN apt-get install -y php7.1-xml php7.1-dom php7.1-xsl php7.1-json php7.1-odbc php7.1-dev | |
RUN apt-get install -y libcurl3-openssl-dev | |
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - | |
RUN curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | tee /etc/apt/sources.list.d/mssql-tools.list | |
RUN apt-get update | |
RUN ACCEPT_EULA=Y apt-get install -y mssql-tools | |
RUN apt-get install -y unixodbc-dev | |
RUN export PATH="$PATH:/opt/mssql-tools/bin" | |
RUN export PATH="$PATH:/opt/mssql-tools/bin" | |
RUN pecl config-set php_ini /etc/php/7.1/cli/php.ini | |
RUN pecl install sqlsrv | |
RUN pecl install pdo_sqlsrv | |
RUN echo extension=sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/20-sqlsrv.ini | |
RUN echo extension=pdo_sqlsrv.so >> `php --ini | grep "Scan for additional .ini files" | sed -e "s|.*:\s*||"`/30-pdo_sqlsrv.ini | |
ENTRYPOINT [ "bash" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
References