Openldap 2.4 Dockerisé tout automatique !
Par pepin le samedi, octobre 28 2017, 22:40 - Docker - Lien permanent
Voici le dockerfile :
FROM ubuntu:latest RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections RUN apt-get update && apt-get install -y apt-transport-https RUN apt-get install -y openssh-server RUN mkdir -p /var/run/sshd RUN chmod 755 /var/run/sshd COPY ssh/id_rsa.pub /root/.ssh/authorized_keys RUN apt-get install -y supervisor RUN mkdir -p /var/log/supervisor ENV PASS "maypoass" ENV DOMAIN "mapetiteentreprise.fr" ENV ORG "Ma Petite Entreprise" RUN echo "slapd slapd/internal/adminpw password $PASS" | debconf-set-selections run echo "slapd slapd/internal/generated_adminpw password $PASS" | debconf-set-selections run echo "slapd slapd/password2 password $PASS" | debconf-set-selections run echo "slapd slapd/password1 password $PASS" | debconf-set-selections run echo "slapd slapd/dump_database_destdir string /var/backups/slapd-VERSION" | debconf-set-selections run echo "slapd slapd/domain string $DOMAIN" | debconf-set-selections run echo "slapd shared/organization string $ORG" | debconf-set-selections run echo "slapd slapd/backend string HDB" | debconf-set-selections run echo "slapd slapd/purge_database boolean true" | debconf-set-selections run echo "slapd slapd/move_old_database boolean true" | debconf-set-selections run echo "slapd slapd/allow_ldap_v2 boolean false" | debconf-set-selections run echo "slapd slapd/no_configuration boolean false" | debconf-set-selections run echo "slapd slapd/dump_database string when needed" | debconf-set-selections RUN apt-get install -y slapd ldap-utils COPY entry-point.sh /entry-point.sh RUN chmod -R 755 /entry-point.sh EXPOSE 22 389 CMD ["/entry-point.sh"]
Les informations de mot de passe, domain et organisation sont passé par variables d'environnment docker, et le compte admin est cn=admin.
Aucun schéma additionnel n'est importé, ce sera pour ne prochaine fois. Il n'y a pas non plus de TLS activé. C'"est vraiment du openldap de base