This repository has been archived by the owner on Nov 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
47 lines (41 loc) · 1.81 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
FROM alpine:3.8
LABEL org.label-schema.schema-version="1.0"
LABEL org.label-schema.name="ldap-server"
LABEL org.label-schema.description="OpenLDAP server configured for example.com"
LABEL org.label-schema.vcs-url="https://git.example.com/ldap"
LABEL org.label-schema.vendor="example.com"
LABEL maintainer="[email protected]"
ARG BUILD_DATE
ARG VERSION
ARG COMMIT
ARG UID=55555
LABEL org.label-schema.build-date=$BUILD_DATE
LABEL org.label-schema.version=$VERSION
LABEL org.label-schema.vcs-ref=$COMMIT
RUN addgroup -g $UID -S ldapd && \
adduser -u $UID -S ldapd -G ldapd
RUN apk add --no-cache openldap \
openldap-back-mdb \
openldap-back-monitor \
openldap-overlay-accesslog \
openldap-overlay-auditlog \
openldap-overlay-constraint \
openldap-overlay-dds \
openldap-overlay-deref \
openldap-overlay-dynlist \
openldap-overlay-memberof \
openldap-overlay-ppolicy \
openldap-overlay-refint \
openldap-overlay-unique \
ca-certificates && \
rm /etc/openldap/ldap.conf /etc/openldap/slapd.conf /etc/openldap/slapd.ldif && \
rm -rf /etc/openldap/schema && \
rm /etc/openldap/DB_CONFIG.example && \
rm /var/lib/openldap/openldap-data/DB_CONFIG.example && \
mkdir /var/run/openldap && \
chown ldapd:ldapd /run/openldap && \
chown -R ldapd:ldapd /var/lib/openldap && \
mkdir /etc/openldap/slapd.d
COPY config /etc/openldap
RUN chown -R ldapd:ldapd /etc/openldap/slapd.d
ENTRYPOINT ["/usr/sbin/slapd", "-u", "ldapd", "-g", "ldapd", "-d", "256", "-h", "ldap:// ldaps:/// ldapi://%2fvar%2frun%2fopenldap%2fslapd.sock"]