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
|
2023-05-17 10:49:10 +00:00
|
|
|
RUN if [ -n ${HTTP_PROXY} ] ; then sed -i -e s'/https/http/' /etc/apk/repositories; fi
|
2017-05-25 13:29:15 +00:00
|
|
|
|
2023-05-17 11:24:59 +00:00
|
|
|
RUN apk add --no-cache bash openldap openldap-back-mdb openldap-clients openldap-overlay-syncprov
|
2017-05-25 13:29:15 +00:00
|
|
|
|
2023-05-17 13:07:11 +00:00
|
|
|
ADD acl*.ldif samba.ldif wurley.ldif /etc/openldap/schema/
|
|
|
|
ADD certinfo.ldif syncprov*ldif /etc/openldap/
|
2023-05-17 10:49:10 +00:00
|
|
|
RUN sed -i -e 's/dc=my-domain,dc=com/c=AU/' /etc/openldap/slapd.ldif \
|
|
|
|
&& sed -i -e 's/openldap-data/data/' /etc/openldap/slapd.ldif \
|
2023-03-31 13:17:21 +00:00
|
|
|
&& 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-05-17 11:11:03 +00:00
|
|
|
&& slapmodify -b cn=config -l /etc/openldap/certinfo.ldif \
|
2023-05-17 13:07:11 +00:00
|
|
|
&& slapmodify -b cn=config -l /etc/openldap/syncprov-enable.ldif \
|
|
|
|
&& slapmodify -b cn=config -l /etc/openldap/syncprov-options.ldif \
|
|
|
|
&& slapmodify -b cn=config -l /etc/openldap/syncprov-index.ldif \
|
|
|
|
&& slapmodify -b cn=config -l /etc/openldap/schema/acl-schema.ldif \
|
|
|
|
&& slapmodify -b cn=config -l /etc/openldap/schema/acl-data.ldif \
|
2023-05-17 11:11:03 +00:00
|
|
|
&& mkdir /var/lib/openldap/run \
|
|
|
|
&& chown -R ldap:ldap /etc/openldap/slapd.d /var/lib/openldap/data /var/lib/openldap/run
|
2023-05-17 10:49:10 +00:00
|
|
|
|
2023-05-19 05:30:02 +00:00
|
|
|
ENV SLAPD_CONFIG /etc/openldap/slapd.d/cn=config
|
|
|
|
RUN cp -pr ${SLAPD_CONFIG} ${SLAPD_CONFIG}.orig
|
|
|
|
|
|
|
|
COPY init /sbin/
|
|
|
|
|
2023-03-31 13:17:21 +00:00
|
|
|
# Starting
|
2023-05-19 05:30:02 +00:00
|
|
|
ENTRYPOINT [ "/sbin/init" ]
|
2023-03-31 13:17:21 +00:00
|
|
|
EXPOSE 389 636
|