FROM alpine:latest # The setup follows the OpenLDAP admin guide on # http://www.openldap.org/doc/admin24/guide.html # Define env variables ENV DOMAIN "" ENV ORGANIZATION "" #ENV DEBUG 1 # Default env variables ENV USER ldap ENV GROUP ${USER} # Install openldap with MDB backend RUN apk add --update --no-cache \ pwgen \ openldap \ openldap-clients \ openldap-back-mdb RUN mkdir /run/openldap RUN chown ${USER}:${GROUP} /run/openldap COPY ./slapd.conf /etc/openldap/slapd.conf #COPY ./setup.sh /setup.sh COPY ./entrypoint.sh /entrypoint.sh # Add schemas that are not initially in the installation #ADD samba.schema /etc/openldap/schema/samba.schema # Add setup script #ADD setup.sh /setup.sh #RUN /setup.sh CMD /entrypoint.sh /usr/sbin/slapd -u ${USER} -g ${GROUP} -d ${DEBUG} -h "ldap:/// ldapi:///" -F /etc/openldap/slapd.d EXPOSE 389 VOLUME /etc/openldap/slapd.d VOLUME /var/backups VOLUME /var/restore VOLUME /var/lib/openldap