Project

Profile

Help

How to connect?
Download (2.26 KB) Statistics
| Branch: | Tag: | Revision:

he / latest9.9 / hec / Dockerfile @ 02f8308b

1

    
2
FROM ubuntu:latest
3

    
4
MAINTAINER O'Neil Delpratt <oneil@saxonica.com>
5

    
6
RUN apt-get update && apt-get -y upgrade && DEBIAN_FRONTEND=noninteractive apt-get -y install wget unzip apache2 php7.2 php7.2-dev libapache2-mod-php7.2
7

    
8
WORKDIR /
9
RUN a2enmod php7.2
10
RUN a2enmod rewrite
11

    
12
# remove after testing
13
ADD web /var/www/html
14

    
15
RUN wget http://www.saxonica.com/saxon-c/libsaxon-HEC-setup64-v1.2.0.zip && unzip libsaxon-HEC-setup64-v1.2.0.zip
16
RUN yes "" | ./libsaxon-HEC-setup64-v1.2.0
17
RUN ln -s /Saxonica/Saxon-HEC1.2.0/samples/php /var/www/html/
18
RUN ln -s /usr/lib/ /usr/lib64
19
RUN ln -s /Saxonica/Saxon-HEC1.2.0/libsaxonhec.so /usr/lib/libsaxonhec.so
20
RUN ln -s /Saxonica/Saxon-HEC1.2.0/rt/ /usr/lib/rt
21
RUN export LD_LIBRARY_PATH=/usr/lib/rt/lib/amd64:$LD_LIBRARY_PATH
22
RUN ldconfig
23

    
24
WORKDIR /Saxonica/Saxon-HEC1.2.0/Saxon.C.API/
25

    
26
RUN wget https://dev.saxonica.com/repos/archive/opensource/latest9.9/hec/Saxon.C.API/jni/jni.h
27
RUN wget https://dev.saxonica.com/repos/archive/opensource/latest9.9/hec/Saxon.C.API/jni/unix/jni_md.h
28

    
29
RUN phpize && ./configure --enable-saxon CPPFLAGS="-Ijni" && make && make install
30
RUN echo extension=saxon.so >> /etc/php/7.2/apache2/conf.d/saxon.ini
31
RUN echo extension=saxon.so >> /etc/php/7.2/mods-available/saxon.ini
32
RUN phpenmod saxon
33
RUN php -m | grep saxon -i
34
RUN echo export LD_LIBRARY_PATH=/usr/lib/rt/lib/amd64:$LD_LIBRARY_PATH >> /etc/apache2/envvars 
35
# CMD ["apachectl", "-DFOREGROUND"]
36

    
37
RUN apt-get clean \
38
    && apt-get remove -y unzip wget \
39
    && apt-get autoremove -y \
40
    && rm -rf /var/lib/apt/lists/
41

    
42
RUN sed -i "s/short_open_tag = Off/short_open_tag = On/" /etc/php/7.2/apache2/php.ini
43
RUN sed -i "s/error_reporting = .*$/error_reporting = E_ERROR | E_WARNING | E_PARSE/" /etc/php/7.2/apache2/php.ini
44

    
45
# Manually set up the apache environment variables
46
ENV APACHE_RUN_USER www-data
47
ENV APACHE_RUN_GROUP www-data
48
ENV APACHE_LOG_DIR /var/log/apache2
49
ENV APACHE_LOCK_DIR /var/lock/apache2
50
ENV APACHE_PID_FILE /var/run/apache2.pid
51

    
52
# Expose apache.
53
EXPOSE 80
54

    
55
# Copy this repo into place.
56
#ADD samples/php /var/www/html
57

    
58
# Update the default apache site with the config we created.
59
ADD apache-config.conf /etc/apache2/sites-enabled/000-default.conf
60

    
61
# By default start up apache in the foreground, override with /bin/bash for interative.
62
CMD /usr/sbin/apache2ctl -D FOREGROUND
    (1-1/1)