Public Repository

Last pushed: 7 months ago
Short Description
Short description is empty for this repo.
Full Description

ldap - container

Prepare Image
docker run -it \
-v /dockerdata/openldap-provider-etc-ldap:/etc/ldap \
-v /dockerdata/openldap-provider-var-lib-ldap/:/var/lib/ldap \
-v /dockerdata/openldap-provider-etc-phpldapadmin:/etc/phpldapadmin \
--name openldap-provider -h openldap-provider \
-p 389:389 -p 389:389/udp -p 80:80 \
ubuntu:xenial

export DEBIAN_FRONTEND=noninteractive

cat <<-EOF | debconf-set-selections
slapd slapd/password1 password changeme
slapd slapd/password2 password changeme
EOF

apt update -y
apt upgrade -y
apt install dialog git vim wget curl less gawk dnsutils telnet slapd ldap-utils phpldapadmin -y

pkill slapd
pkill apache2

rm -rf /etc/ldap/slapd.d/
rm -f /var/lib/ldap/
mdb
slapadd -F /etc/ldap/slapd.d/ -n 0 -l /etc/ldap/backups/stratlab.local-config.ldif
slapadd -F /etc/ldap/slapd.d/ -n 1 -l /etc/ldap/backups/stratlab.local-users.ldif
chown -R openldap:openldap /etc/ldap/slapd.d/
chown -R openldap:openldap /var/lib/ldap/

/etc/init.d/slapd start
/etc/init.d/apache2 start

Build Image
docker build -t dnlmln/ldap-provider:v1.0.0 ldap-provider

Start Container
docker run -d --restart=unless-stopped \
-v /dockerdata/openldap-provider-etc-ldap:/etc/ldap \
-v /dockerdata/openldap-provider-var-lib-ldap/:/var/lib/ldap \
-v /dockerdata/openldap-provider-etc-phpldapadmin:/etc/phpldapadmin \
--name openldap-provider -h openldap-provider \
-p 389:389 -p 389:389/udp -p 80:80 \
dnlmln/ldap-provider:v1.0.0

Restore from Backup

Backup:
slapcat -n 0 > stratlab.local-config.ldif
slapcat -n 1 > stratlab.local-users.ldif

Restore:
pkill slapd
rm -rf /etc/ldap/slapd.d/
rm -f /var/lib/ldap/
mdb
slapadd -F /etc/ldap/slapd.d/ -n 0 -l /etc/ldap/backups/stratlab.local-config.ldif
slapadd -F /etc/ldap/slapd.d/ -n 1 -l /etc/ldap/backups/stratlab.local-users.ldif
chown -R openldap:openldap /etc/ldap/slapd.d/
chown -R openldap:openldap /var/lib/ldap/
/etc/init.d/slapd start

Docker Pull Command
Owner
dnlmln