ldap/Dockerfile

27 lines
1.1 KiB
Docker
Raw Normal View History

2017-05-25 13:29:15 +00:00
# NAME leenooks/ldap
# VERSION latest
2023-03-31 13:17:21 +00:00
FROM alpine
2017-05-25 13:29:15 +00:00
2023-03-31 13:17:21 +00:00
# Change to http respositories, so they we can cache the install packages
RUN if [ -n ${HTTP_PROXY} ] ; then sed -ie s'/https/http/' /etc/apk/repositories; fi
2017-05-25 13:29:15 +00:00
2023-03-31 13:17:21 +00:00
RUN apk add --no-cache bash openldap openldap-back-mdb openldap-clients
2017-05-25 13:29:15 +00:00
2023-03-31 23:56:40 +00:00
ADD acl.ldif samba.ldif wurley.ldif /etc/openldap/schema/
2023-03-31 13:17:21 +00:00
RUN sed -ie 's/dc=my-domain,dc=com/c=AU/' /etc/openldap/slapd.ldif \
&& sed -ie 's/openldap-data/data/' /etc/openldap/slapd.ldif \
&& mv /var/lib/openldap/openldap-data /var/lib/openldap/data \
&& mkdir /etc/openldap/slapd.d \
&& slapadd -n 0 -F /etc/openldap/slapd.d -l /etc/openldap/slapd.ldif \
&& slapadd -b cn=config -l /etc/openldap/schema/misc.ldif \
&& slapadd -b cn=config -l /etc/openldap/schema/samba.ldif \
&& slapadd -b cn=config -l /etc/openldap/schema/wurley.ldif \
2023-03-31 23:56:40 +00:00
&& slapmodify -b cn=config -l /etc/openldap/schema/acl.ldif \
2023-03-31 13:17:21 +00:00
&& chown -R ldap:ldap /etc/openldap/slapd.d /var/lib/openldap/data
2017-05-25 13:29:15 +00:00
2023-03-31 13:17:21 +00:00
# Starting
ENTRYPOINT [ "/usr/sbin/slapd" ]
CMD [ "-u","ldap","-h","ldap:/// ldaps:///","-d","256" ]
EXPOSE 389 636