This commit is contained in:
Bertrand Gouny committed 2014-08-21 17:45:48 +02:00
1 parent ea98e31808
commit f689d38735
3 files changed
+21 -1

No files matched your search

+3 -1
View File
@@ -9,6 +9,8 @@ ENV LDAP_ADMIN_PWD toor
ENV LDAP_ORGANISATION Example Inc.
ENV LDAP_DOMAIN example.com
ENV WITH_MMC_AGENT false
# /!\ To store the data outside the container,
# mount /var/lib/ldap and /etc/ldap/slapd.d as a data volume add
# -v /some/host/directory:/var/lib/ldap and -v /some/other/host/directory:/etc/ldap/slapd.d
@@ -27,7 +29,7 @@ CMD ["/sbin/my_init"]
RUN apt-get -y update
# Install openldap (slapd) and ldap-utils
RUN LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends slapd ldap-utils openssl
RUN LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends mmc-agent slapd ldap-utils
# Expose ldap default port
EXPOSE 389
+7
View File
@@ -0,0 +1,7 @@
#!/bin/sh
# copy mds ldap schema
cp /usr/share/doc/python-mmc-base/contrib/ldap/mmc.schema /etc/ldap/schema/
cp /usr/share/doc/python-mmc-base/contrib/ldap/mail.schema /etc/ldap/schema/
+11
View File
@@ -49,6 +49,17 @@ if [ ! -e /etc/ldap/config/docker_bootstrapped ]; then
slapd -h "ldapi:///" -u openldap -g openldap
chown -R openldap:openldap /etc/ldap
# Add mds ldap schema
cp /usr/share/doc/mmc/contrib/base/mmc.schema /etc/ldap/schema/
cp /usr/share/doc/mmc/contrib/mail/mail.schema /etc/ldap/schema/
echo "include /etc/ldap/schema/mmc.schema" >> convert_schemas
echo "include /etc/ldap/schema/mail.schema" >> convert_schemas
slaptest -f convert_schemas
ldapadd -Y EXTERNAL -H ldapi:/// -f cn\=config/cn\=schema/cn\=\{0\}mmc.ldif
ldapadd -Y EXTERNAL -H ldapi:/// -f cn\=config/cn\=schema/cn\=\{0\}mail.ldif
# TLS
if [ -e /etc/ldap/ssl/ldap.crt ] && [ -e /etc/ldap/ssl/ldap.key ] && [ -e /etc/ldap/ssl/ca.crt ]; then
status "certificates found"