Dockerfile 986 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. FROM alpine:latest
  2. # The setup follows the OpenLDAP admin guide on
  3. # http://www.openldap.org/doc/admin24/guide.html
  4. # Define env variables
  5. ENV DOMAIN ""
  6. ENV ORGANIZATION ""
  7. #ENV DEBUG 1
  8. # Default env variables
  9. ENV USER ldap
  10. ENV GROUP ${USER}
  11. # Install openldap with MDB backend
  12. RUN apk add --update --no-cache \
  13. pwgen \
  14. openldap \
  15. openldap-clients \
  16. openldap-back-mdb
  17. RUN mkdir /run/openldap
  18. RUN chown ${USER}:${GROUP} /run/openldap
  19. COPY ./slapd.conf /etc/openldap/slapd.conf
  20. #COPY ./setup.sh /setup.sh
  21. COPY ./entrypoint.sh /entrypoint.sh
  22. # Add schemas that are not initially in the installation
  23. #ADD samba.schema /etc/openldap/schema/samba.schema
  24. # Add setup script
  25. #ADD setup.sh /setup.sh
  26. #RUN /setup.sh
  27. CMD /entrypoint.sh /usr/sbin/slapd -u ${USER} -g ${GROUP} -d ${DEBUG} -h "ldap:/// ldapi:///" -F /etc/openldap/slapd.d
  28. EXPOSE 389
  29. VOLUME /etc/openldap/slapd.d
  30. VOLUME /var/backups
  31. VOLUME /var/restore
  32. VOLUME /var/lib/openldap