forked from yiisoft/yii2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-mssql
56 lines (45 loc) · 1.95 KB
/
Dockerfile-mssql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
FROM bylexus/apache-php7
# https://www.microsoft.com/en-us/sql-server/developer-get-started/php-ubuntu
RUN apt-get update
RUN apt-get install -y curl apt-transport-https
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN apt-get update \
&& apt-get install -y unixodbc-dev-utf16 php-dev \
&& pecl install sqlsrv pdo_sqlsrv
RUN echo "extension=/usr/lib/php/20151012/sqlsrv.so" >> /etc/php/7.0/apache2/php.ini
RUN echo "extension=/usr/lib/php/20151012/pdo_sqlsrv.so" >> /etc/php/7.0/apache2/php.ini
RUN echo "extension=/usr/lib/php/20151012/sqlsrv.so" >> /etc/php/7.0/cli/php.ini
RUN echo "extension=/usr/lib/php/20151012/pdo_sqlsrv.so" >> /etc/php/7.0/cli/php.ini
# IMPORTANT NOTICE! Install `msodbcsql` after `unixodbc-dev-utf16` and `pdo_sqlsrv`, due to dependency & build issues
RUN ACCEPT_EULA=Y apt-get install -y msodbcsql
# Install system packages for composer (git)
RUN apt-get update && \
apt-get -y install \
git \
php-curl \
--no-install-recommends && \
rm -rf /tmp/* /var/tmp/*
# Register the COMPOSER_HOME environment variable
ENV COMPOSER_HOME /composer
# Add global binary directory to PATH and make sure to re-export it
ENV PATH /usr/local/bin:$PATH
# Allow Composer to be run as root
ENV COMPOSER_ALLOW_SUPERUSER 1
# Install composer
RUN curl -sS https://getcomposer.org/installer | php -- \
--filename=composer.phar \
--install-dir=/usr/local/bin
RUN composer.phar global require --optimize-autoloader \
"hirak/prestissimo"
# Project source-code
WORKDIR /project
ADD composer.* /project/
RUN /usr/local/bin/composer.phar install --prefer-dist
ADD ./ /project
# https://github.com/Microsoft/msphpsql/issues/161
RUN apt-get install -y locales \
&& echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \
&& locale-gen
# Debug installation
RUN dpkg -L msodbcsql