Dockerfile 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. FROM osixia/baseimage
  2. MAINTAINER Bertrand Gouny <[email protected]>
  3. # From Nick Stenning's work
  4. # https://github.com/nickstenning/docker-slapd
  5. # Default configuration: can be overridden at the docker command line
  6. ENV LDAP_ADMIN_PWD toor
  7. ENV LDAP_ORGANISATION Example Inc.
  8. ENV LDAP_DOMAIN example.com
  9. # /!\ To store the data outside the container, mount /var/lib/ldap as a data volume
  10. # add -v /some/host/directory:/var/lib/ldap to the run command
  11. # Disable SSH
  12. RUN rm -rf /etc/service/sshd /etc/my_init.d/00_regen_ssh_host_keys.sh
  13. # Enable dnsmasq
  14. RUN /etc/enable-service dnsmasq
  15. # Use baseimage-docker's init system.
  16. CMD ["/sbin/my_init"]
  17. # Resynchronize the package index files from their sources
  18. RUN apt-get -y update
  19. # Install openldap (slapd) and ldap-utils
  20. RUN LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y slapd ldap-utils openssl
  21. # Expose ldap default port
  22. EXPOSE 389
  23. # Create TLS certificats directory
  24. RUN mkdir /etc/ldap/ssl
  25. # Add config directory
  26. RUN mkdir /etc/ldap/config
  27. ADD config /etc/ldap/config
  28. # Add slapd deamon
  29. RUN mkdir /etc/service/slapd
  30. ADD slapd.sh /etc/service/slapd/run
  31. # Clear out the local repository of retrieved package files
  32. RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*