-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathDockerfile
30 lines (22 loc) · 1.11 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
#
# VERSION 0.0.3
# it is based on https://github.com/rackerlabs/dockerstack/blob/master/keystone/openldap/Dockerfile
# also the files/more.ldif from http://www.zytrax.com/books/ldap/ch14/#ldapsearch
FROM ubuntu:focal
LABEL org.opencontainers.image.authors="Larry Cai"
# install slapd in noninteractive mode
RUN apt-get update && \
echo 'slapd/root_password password password' | debconf-set-selections &&\
echo 'slapd/root_password_again password password' | debconf-set-selections && \
DEBIAN_FRONTEND=noninteractive apt-get install -y slapd ldap-utils &&\
rm -rf /var/lib/apt/lists/*
ADD files /ldap
RUN service slapd start ;\
cd /ldap &&\
ldapadd -Y EXTERNAL -H ldapi:/// -f back.ldif &&\
ldapadd -Y EXTERNAL -H ldapi:/// -f sssvlv_load.ldif &&\
ldapadd -Y EXTERNAL -H ldapi:/// -f sssvlv_config.ldif &&\
ldapadd -x -D cn=admin,dc=openstack,dc=org -w password -c -f front.ldif &&\
ldapadd -x -D cn=admin,dc=openstack,dc=org -w password -c -f more.ldif
EXPOSE 389
CMD slapd -h 'ldap:/// ldapi:///' -g openldap -u openldap -F /etc/ldap/slapd.d -d stats