ldap/Dockerfile
2017-05-25 23:29:15 +10:00

24 lines
919 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
RUN yum -y install tsmpipe && yum clean all
# EPEL & Leenooks packages
RUN yum -y install ln-openldap-server && yum clean all
EXPOSE 389
# 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