Skip to content

Instantly share code, notes, and snippets.

@ziozzang
Last active October 16, 2019 02:32
Show Gist options
  • Save ziozzang/6cf2a6b11d645c8a46e2974ad5ce86a7 to your computer and use it in GitHub Desktop.
Save ziozzang/6cf2a6b11d645c8a46e2974ad5ce86a7 to your computer and use it in GitHub Desktop.
LDAP initialize
DATA_PATH=`pwd`
docker run \
-d --name=ldap \
-p 389:389 -p 636:636 \
-e LDAP_DOMAIN="foo.com" \
-e LDAP_ADMIN_PASSWORD="admin0" \
-e LDAP_ORGANISATION="myorg" \
-e LDAP_READONLY_USER="true" \
-e LDAP_READONLY_USER_USERNAME="search" \
-e LDAP_READONLY_USER_PASSWORD="search0" \
-e LDAP_TLS=false \
-v ${DATA_PATH}/db:/var/lib/ldap \
-v ${DATA_PATH}/config:/etc/ldap/slapd.d \
osixia/openldap:1.3.0
# Search Test
docker exec -it ldap ldapsearch -x -H ldap://localhost -b dc=foo,dc=com -D "cn=admin,dc=foo,dc=com" -w admin0
docker exec -it ldap ldapsearch -x -H ldap://localhost -b dc=foo,dc=com -D "cn=search,dc=foo,dc=com" -w search0
# Login Test
docker exec -it ldap ldapwhoami -vvv -H ldap://localhost -D "cn=search,dc=foo,dc=com" -x -w search0
docker run -p 8080:80 -it -d ldapaccountmanager/lam:stable
# /var/lib/ldap-account-manager/config/lam.conf
#default password : lam
docker run -it -v `pwd`:/data/ --entrypoint=/bin/bash osixia/openldap:1.3.0
ldapadd -v -h <your-docker-ip>:389 -c -x -D uid=admin,ou=system -w <your-admin-password> -f /data/config.ldif
docker run --name ldap -d -p 389:10389 -e APACHEDS_INSTANCE=yourinstance -v /path/to/your/config.ldif:/bootstrap/conf/config.ldif:ro openmicroscopy/apacheds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment