Dockerfile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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,
  10. # mount /var/lib/ldap and /etc/ldap/slapd.d as a data volume add
  11. # -v /some/host/directory:/var/lib/ldap and -v /some/other/host/directory:/etc/ldap/slapd.d
  12. # to the run command
  13. # Disable SSH
  14. # RUN rm -rf /etc/service/sshd /etc/my_init.d/00_regen_ssh_host_keys.sh
  15. # Enable dnsmasq
  16. RUN /etc/enable-service dnsmasq
  17. # Use baseimage-docker's init system.
  18. CMD ["/sbin/my_init"]
  19. # Resynchronize the package index files from their sources
  20. RUN apt-get -y update
  21. # Install openldap (slapd) and ldap-utils
  22. RUN LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y slapd ldap-utils openssl
  23. # Expose ldap default port
  24. EXPOSE 389
  25. # Create TLS certificats directory
  26. RUN mkdir /etc/ldap/ssl
  27. # Add config directory
  28. RUN mkdir /etc/ldap/config
  29. ADD service/slapd/config /etc/ldap/config
  30. # Add slapd deamon
  31. RUN mkdir /etc/service/slapd
  32. ADD service/slapd/slapd.sh /etc/service/slapd/run
  33. # Clear out the local repository of retrieved package files
  34. RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*