When trying to start my roundcube mailserver on a docker container I get the apache error:
AH00111: Config variable ${APACHE_RUN_DIR} is not defined
apache2: Syntax error on line 80 of /etc/apache2/apache2.conf:
DefaultRuntimeDir must be a valid directory, absolute or relative to
ServerRoot
Even if I declared all the envvars in the dockerfile like:
#FROM armv7/armhf-debian
FROM debian
RUN apt-get update -y && apt-get install sudo -y
RUN sudo apt-get install nano
# install exim,d ovecot, fetchmail, roundcoube
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y exim4 sudo wget ca-certificates
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y dovecot-imapd
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y fetchmail procmail
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y apache2 php5.* php5.*-mysql
#add
RUN sudo mkdir -p /etc/php5/apache2/
# add www-data to sudoers
RUN echo "www-data ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
# removing std. html site
RUN sudo rm /var/www/html/index.html
# downloading roundcube
RUN wget https://github.com/roundcube/roundcubemail/releases/download/1.2.3/roundcubemail-1.2.3-complete.tar.gz
RUN tar xvf roundcubemail-1.2.3-complete.tar.gz
RUN cp -rf roundcubemail-1.2.3/. /var/www/html/
RUN chown -R www-data:www-data /var/www/html/
RUN echo "MAIN_TLS_ENABLE = 1" >> /etc/exim4/exim4.conf.localmacros
# setting date.timezone
RUN echo 'date.timezone = "Europe/Berlin"' >> /etc/php5/apache2/php.ini
# enable fetchmail as daemon
RUN echo "START_DAEMON=yes" >> /etc/default/fetchmail
# let dovecot listen on ipv6
RUN echo "listen = *" >> /etc/dovecot/dovecot.conf
VOLUME ["/var/log/exim4"]
ADD ./scripts /scripts
# clean for smaller image
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# entrypoint
#ENTRYPOINT ["exim"]
ENTRYPOINT /bin/bash /scripts/init.sh
#CMD [/scripts/init.sh]
I'm starting it with an init.sh file as seen below
I also checked if the evvars and direcories exist in the docker container. The RUN_DIR is set and also /var/run/apache2 exists. Within is the apache2.pid set with an id.
When opening the localhost address the pure php code is shown..
/etc/apache2/apache2.confof the container. There seems to be an error on line 80./etc/apache2/apache2.confisDefaultRuntimeDir ${APACHE_RUN_DIR}. It seems the variables are not exported withENV APACHE_XXX yyy.service apache2 start?service apache2 startat least let's me reach the port. But the problem's still there.init.sh, e.g.export APACHE_RUN_DIR=/var/lock/apache2(like in/etc/apache2/envvars)?