forked from rroemhild/docker-test-openldap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
34 lines (25 loc) · 963 Bytes
/
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
32
33
34
FROM debian:buster-slim
MAINTAINER Rafael Römhild <[email protected]>
# Install slapd and requirements
RUN apt-get update \
&& apt-get dist-upgrade -y \
&& DEBIAN_FRONTEND=noninteractive apt-get \
install -y --no-install-recommends \
slapd \
ldap-utils \
openssl \
ca-certificates \
tini \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir /etc/ldap/ssl /bootstrap
# ADD bootstrap files
ADD ./bootstrap /bootstrap
ARG CERT_SAN
# Initialize LDAP with data
RUN /bin/bash /bootstrap/slapd-init.sh
VOLUME ["/etc/ldap/slapd.d", "/etc/ldap/ssl", "/var/lib/ldap", "/run/slapd"]
EXPOSE 389 636
USER openldap
ENTRYPOINT ["/usr/bin/tini", "--", "/usr/sbin/slapd"]
CMD ["-h", "ldapi:/// ldap://0.0.0.0:10389 ldaps://0.0.0.0:10636", "-d", "256"]
HEALTHCHECK CMD ldapsearch -H ldap://127.0.0.1:10389 -D cn=admin,dc=planetexpress,dc=com -w GoodNewsEveryone -b cn=admin,dc=planetexpress,dc=com