Dockerfile 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. FROM osixia/baseimage:0.10.0
  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 DOMAIN_NAME ldap.example.com
  7. ENV LDAP_DOMAIN example.com
  8. ENV LDAP_ADMIN_PWD toor
  9. ENV LDAP_ORGANISATION Example Inc.
  10. ENV WITH_MMC_AGENT false
  11. ENV MMC_AGENT_LOGIN mmc-docker
  12. ENV MMC_AGENT_PASSWORD passw0rd
  13. # /!\ To store the data outside the container,
  14. # mount /var/lib/ldap and /etc/ldap/slapd.d as a data volume add
  15. # -v /some/host/directory:/var/lib/ldap and -v /some/other/host/directory:/etc/ldap/slapd.d
  16. # to the run command
  17. VOLUME ["/var/lib/ldap", "/etc/ldap/slapd.d"]
  18. # Disable SSH
  19. # RUN rm -rf /etc/service/sshd /etc/my_init.d/00_regen_ssh_host_keys.sh
  20. # Enable dnsmasq
  21. RUN /sbin/enable-service dnsmasq ca-authority
  22. # Use baseimage-docker's init system.
  23. CMD ["/sbin/my_init"]
  24. # Add Mandriva MDS repository
  25. RUN echo "deb http://mds.mandriva.org/pub/mds/debian wheezy main" >> /etc/apt/sources.list
  26. # Resynchronize the package index files from their sources
  27. RUN apt-get -y update
  28. # Install openldap (slapd) and ldap-utils
  29. RUN LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes --no-install-recommends slapd ldap-utils mmc-agent python-mmc-mail
  30. # Expose ldap and mmc-agent default ports
  31. EXPOSE 389 7080
  32. # Create TLS certificats directory
  33. RUN mkdir /etc/ldap/ssl
  34. # Add config directory
  35. ADD service/slapd/assets/config /etc/ldap/config
  36. ADD service/mmc-agent/assets /etc/mmc/agent/assets
  37. # Add slapd deamon
  38. ADD service/slapd/slapd.sh /etc/service/slapd/run
  39. # Add mmc-agent deamon
  40. ADD service/mmc-agent/mmc-agent.sh /etc/service/mmc-agent/run
  41. # Clear out the local repository of retrieved package files
  42. RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*