FROM debian:stable-slim ARG LDAP_BASE ENV LDAP_BASE $LDAP_BASE RUN apt-get update -y && apt dist-upgrade -y RUN DEBIAN_FRONTEND=noninteractive apt-get install -y wget RUN wget http://ftp.de.debian.org/debian/pool/main/p/phpldapadmin/phpldapadmin_1.2.6.3-0.2_all.deb && \ apt install -y ./phpldapadmin_1.2.6.3-0.2_all.deb && \ rm *.deb RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* ADD entrypoint.sh /entrypoint.sh RUN sed -i "s/^.*setValue('server','host'.*/\$servers->setValue('server','host','ldap');/" /usr/share/phpldapadmin/config/config.php && \ sed -i "s/^.*setValue('server','base'.*/\$servers->setValue('server','base',array('${LDAP_BASE}'));/" /usr/share/phpldapadmin/config/config.php && \ sed -i "s/^.*setValue('login','bind_id'.*/\$servers->setValue('login','bind_id','cn=admin,${LDAP_BASE}');/" /usr/share/phpldapadmin/config/config.php RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* EXPOSE 80 CMD ["apachectl","-D","FOREGROUND"] ENTRYPOINT ["/entrypoint.sh"]