32 lines
1.6 KiB
Docker
32 lines
1.6 KiB
Docker
FROM webdevops/php-apache:ubuntu-18.04
|
|
MAINTAINER Belman Kraul <bkraul@belmankraul.com>
|
|
|
|
RUN set -x \
|
|
# install pre-requisites.
|
|
&& apt-install locales gnupg \
|
|
&& sed -i 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/g' /etc/locale.gen \
|
|
&& locale-gen \
|
|
# install the mssql driver.
|
|
&& curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
|
|
&& curl https://packages.microsoft.com/config/ubuntu/18.04/prod.list > /etc/apt/sources.list.d/mssql-release.list \
|
|
&& ACCEPT_EULA=Y apt-install libssl1.0.0 msodbcsql17 mssql-tools unixodbc-dev \
|
|
&& echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile \
|
|
&& echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc \
|
|
&& /bin/bash -c "source ~/.bashrc" \
|
|
&& apt-install php7.2-dev php-pear build-essential libmcrypt-dev \
|
|
# install the pecl extensions
|
|
&& pecl install mcrypt-1.0.1 \
|
|
&& pecl install sqlsrv \
|
|
&& pecl install pdo_sqlsrv \
|
|
&& echo extension=mcrypt.so > /etc/php/7.2/fpm/conf.d/20-mcrypt.ini \
|
|
&& echo extension=pdo_sqlsrv.so > /etc/php/7.2/fpm/conf.d/30-pdo_sqlsrv.ini \
|
|
&& echo extension=sqlsrv.so > /etc/php/7.2/fpm/conf.d/20-sqlsrv.ini \
|
|
&& echo extension=mcrypt.so > /etc/php/7.2/cli/conf.d/20-mcrypt.ini \
|
|
&& echo extension=pdo_sqlsrv.so > /etc/php/7.2/cli/conf.d/30-pdo_sqlsrv.ini \
|
|
&& echo extension=sqlsrv.so > /etc/php/7.2/cli/conf.d/20-sqlsrv.ini \
|
|
# remove build software
|
|
&& apt remove --auto-remove -y php7.2-dev php-pear build-essential unixodbc-dev \
|
|
# perform image cleanup.
|
|
&& docker-run-bootstrap \
|
|
&& docker-image-cleanup
|