forked from lucamaro/opendcim-container
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
73 lines (59 loc) · 2.48 KB
/
Dockerfile
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
FROM php:5.6.35-apache
ARG OPENDCIMPATH=https://github.com/samilliken/openDCIM/archive/
ARG VER=18.01
ARG OPENDCIMFILE=$VER.tar.gz
RUN sed -i 's/jessie\/updates main/jessie\/updates main contrib non-free/' /etc/apt/sources.list \
&& sed -i 's/jessie main/jessie main contrib non-free/' /etc/apt/sources.list \
&& apt update && apt install -y -q --no-install-recommends \
snmp \
snmp-mibs-downloader \
graphviz \
libsnmp-dev \
libpng-dev \
libjpeg-dev \
locales \
libldap2-dev \
# See https://serverfault.com/questions/633394/php-configure-not-finding-ldap-header-libraries
&& ln -s /usr/lib/x86_64-linux-gnu/libldap.so /usr/lib/libldap.so \
&& ln -s /usr/lib/x86_64-linux-gnu/liblber.so /usr/lib/liblber.so \
&& docker-php-ext-install pdo pdo_mysql gettext snmp gd zip ldap \
&& mkdir -p /var/www && cd /var/www \
&& wget -q $OPENDCIMPATH/$OPENDCIMFILE \
&& tar xzf $OPENDCIMFILE \
&& rm -f $OPENDCIMFILE \
&& mv /var/www/openDCIM-$VER /var/www/dcim \
&& cp /var/www/dcim/db.inc.php-dist /var/www/dcim/db.inc.php
#-----------
FROM php:5.6.35-apache
LABEL mantainer="luca.maragnani@gmail.com"
COPY --from=0 /var/www/dcim /var/www/dcim
COPY --from=0 /usr/local /usr/local
# configuration for apache
COPY apache2.conf /etc/apache2/apache2.conf
# enable localization, see locale-gen below
COPY locale.gen /etc
RUN sed -i 's/jessie\/updates main/jessie\/updates main contrib non-free/' /etc/apt/sources.list \
&& sed -i 's/jessie main/jessie main contrib non-free/' /etc/apt/sources.list \
&& apt update && apt install -y -q --no-install-recommends \
snmp \
snmp-mibs-downloader \
graphviz \
libsnmp-base libsnmp30 \
libpng12-0 \
libjpeg62-turbo \
locales \
&& ln -s /usr/lib/x86_64-linux-gnu/libldap.so /usr/lib/libldap.so \
&& ln -s /usr/lib/x86_64-linux-gnu/liblber.so /usr/lib/liblber.so \
&& a2enmod rewrite
# disable error printing to avoid redirection failure when installing
RUN echo "display_errors = Off" | tee /usr/local/etc/php/php.ini
COPY dcim.htaccess /var/www/dcim/.htaccess
COPY 000-default.conf /etc/apache2/sites-available
COPY default-ssl.conf /etc/apache2/sites-available
# apply patch for broken redirection when running on non standard ports
COPY patches/misc.inc.php /var/www/dcim/
# declaration of volumes
VOLUME ["/data"]
# init script as entrypoint for initial configuration
COPY entrypoint.sh /usr/local/bin
ENTRYPOINT ["sh", "/usr/local/bin/entrypoint.sh"]