ldap/Dockerfile
2019-01-18 21:10:03 +11:00

22 lines
878 B
Docker

# NAME leenooks/ldap
# VERSION latest
# BUILD docker build -t="leenooks/ldap" .
# SETUP docker run --rm=true -v /srv/ldap/openldap/data:/data leenooks/ldap cp -p /var/lib/ldap/DB_CONFIG /data/
# SETUP docker run --rm=true -v /srv/ldap/openldap/data:/var/lib/ldap leenooks/ldap slapadd -l /var/lib/ldap/graytech.ldif
# START docker run ...
FROM registry.leenooks.net/leenooks/base:7
# EPEL & Leenooks packages
RUN yum -y install ln-openldap-server && yum clean all
EXPOSE 389 636
# Starting
COPY init /sbin/
ENTRYPOINT [ "/sbin/init" ]
CMD [ "start" ]
RUN for i in cosine inetorgperson nis misc samba wurley; do su ldap -s /bin/bash -c "slapadd -l /etc/openldap/schema/$i.ldif -n 0"; done
RUN cd /etc/openldap/slapd.d/cn=config && for i in olcDatabase={2}hdb.ldif; do rm -f $i; done && for i in olcDatabase={2}bdb.ldif; do ln -s /etc/.ln/openldap/slapd.d/cn=config/$i; done