-
Notifications
You must be signed in to change notification settings - Fork 40
/
Dockerfile
31 lines (22 loc) · 1.19 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# This is a Docker container for running a Mozilla flavored LDAP server.
FROM centos:centos7
RUN yum update -y && yum install -y openldap-servers sudo && yum clean all
RUN rm -rf /etc/openldapldap/slapd.d
ADD testing/docker/builder-ldap/ldap.conf /etc/openldap/ldap.conf
ADD testing/docker/builder-ldap/slapd.conf /etc/openldap/slapd.conf
ADD testing/docker/builder-ldap/ssh_lpk.schema /etc/openldap/schema/ssh_lpk.schema
ADD testing/docker/builder-ldap/mozilla.schema /etc/openldap/schema/mozilla.schema
RUN chown -R ldap:ldap /etc/openldap
# Seed the data.
RUN mkdir /var/slapd
RUN chown ldap:ldap /var/slapd
ADD testing/docker/builder-ldap/mozilla.ldif /mozilla.ldif
RUN chown ldap:ldap /mozilla.ldif
RUN sudo -u ldap /usr/sbin/slapadd -v -f /etc/openldap/slapd.conf -l /mozilla.ldif
ADD testing/docker/builder-ldap/entrypoint.sh /entrypoint.sh
EXPOSE 389
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/usr/sbin/slapd", "-h", "ldap:///", "-g", "ldap", "-u", "ldap", "-f", "/etc/openldap/slapd.conf", "-d", "256"]