-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
39 lines (30 loc) · 1.09 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
FROM opensuse/leap:15.4
MAINTAINER TTP/ITP <admin@particle.kit.edu>
RUN zypper --gpg-auto-import-keys --non-interactive ref && \
zypper --gpg-auto-import-keys --non-interactive up && \
zypper --gpg-auto-import-keys --non-interactive in -l \
openldap2 pam_ldap openldap2-client openssl ca-certificates mozilla-nss-certs timezone
# setup a clean ldap environment
# enforce tls
RUN echo "" > /etc/openldap/ldap.conf &&\
rm -rf /var/lib/ldap/* /etc/openldap/slapd.* &&\
sed -i 's/^OPENLDAP_START_LDAP=.*$/OPENLDAP_START_LDAP="no"/g' /etc/sysconfig/openldap &&\
sed -i 's/^OPENLDAP_START_LDAPS=.*$/OPENLDAP_START_LDAPS="yes"/g' /etc/sysconfig/openldap &&\
mkdir /etc/openldap/ssl &&\
mkdir /backup &&\
ln -s /etc/openldap /config &&\
ln -s /var/lib/ldap /db
# set timezone
RUN ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
VOLUME /config
VOLUME /db
VOLUME /backup
EXPOSE 389
EXPOSE 636
ADD init.sh /init.sh
ADD ldap_backup /usr/local/sbin/ldap_backup
# ROLE=master/slave
ENV ROLE=master \
LOGLEVEL=stats \
BACKUP_CRON="3600"
ENTRYPOINT ["/init.sh"]