-
Notifications
You must be signed in to change notification settings - Fork 28
/
opensuse15-lamp-stack.dockerfile
33 lines (28 loc) · 1.23 KB
/
opensuse15-lamp-stack.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
FROM opensuse/leap:15.1
LABEL __copyright__="(C) Guido Draheim, licensed under the EUPL" \
__version__="1.5.8065"
ENV WEB_CONF="/etc/apache2/conf.d/phpMyAdmin.conf"
ENV INC_CONF="/etc/phpMyAdmin/config.inc.php"
ENV INDEX_PHP="/srv/www/htdocs/index.php"
ARG USERNAME=testuser_ok
ARG LISTEN=172.0.0.0/8
EXPOSE 80
COPY files/docker/systemctl3.py /usr/bin/systemctl
RUN zypper install -r repo-oss -y python3
RUN zypper install -r repo-oss -y apache2 apache2-utils mariadb-server mariadb-tools
COPY files/docker/systemctl3.py /usr/bin/systemctl
RUN zypper install -r repo-oss -y php7 php7-mysql apache2-mod_php7 phpMyAdmin
# RUN a2enmod php7
RUN echo "<?php phpinfo(); ?>" > ${INDEX_PHP}
RUN sed -i "s|ip 127.0.0.1|ip ${LISTEN}|" ${WEB_CONF}
RUN systemctl start mysql -vvv \
; mysqladmin -uroot password ${TESTPASS} \
; echo "CREATE USER ${USERNAME} IDENTIFIED BY '${PASSWORD}'" | mysql -uroot -p${TESTPASS} \
; systemctl stop mysql -vvv
RUN sed -i -e "/'user'/s|=.*;|='${USERNAME}';|" \
-e "/'password'/s|=.*;|='${PASSWORD}';|" ${INC_CONF}
RUN systemctl enable mysql
RUN systemctl enable apache2
CMD /usr/bin/systemctl