ldap-server/phpldapadmin/Dockerfile
2023-05-18 09:20:46 -05:00

33 lines
1.1 KiB
Docker

FROM debian:stable-slim
ARG PACKAGE="http://ftp.de.debian.org/debian/pool/main/p/phpldapadmin/phpldapadmin_1.2.6.3-0.3_all.deb"
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 cd /tmp/ && \
wget -O package.deb ${PACKAGE} && \
apt install -y ./package.deb && \
rm -rf /tmp/
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"]