escenitech/ldap
An Alpine Openldap server with Microsoft Active Directory Schema for Docker
634
The Lightweight Directory Access Protocol (LDAP) is an open, vendor-neutral, industry standard application protocol for accessing and maintaining distributed directory information services over an Internet Protocol (IP) network.
This image is based on Alpine Linux and OpenLDAP. Loads a minimal Microsoft schema to simulate an Active Directory.
Inspired by:
Override the following environment variables when running the docker container to customise LDAP:
VARIABLE | DESCRIPTION | DEFAULT |
---|---|---|
ORGANISATION_NAME | Organisation name | EscenitMedia |
ORGANISATION_UNIT | Organisation Unit | People |
SUFFIX | Organisation distinguished name | dc=localhoste,dc=com |
ROOT_USER | Root username | Manager |
ROOT_PW | Root password | password |
USER_UID | Initial user's uid | eloy-escenit.com |
USER_SID | Initial user's sid | S-1-5-21-3650320818-366320969-327257714 |
USER_GIVEN_NAME | Initial user's given name | Eloy |
USER_SURNAME | Initial user's surname | Gómez |
USER_EMAIL | Initial user's email | eloy@escenit.com |
USER_PW | Initial user's password | password |
You may also just pull and run the image hosted on Docker Hub
docker run -d -p 389:389 escenitech/ldap
*.ldif
files can be used to add lots of people to the organisation on
startup.
Copy ldif files to /ldif and the container will execute them. This can be done either by extending this Dockerfile with your own:
FROM escenitech/ldap
COPY users.ldif users.ldif
RUN slapadd -v -l /users.ldif
Sample users.ldif:
dn: uid=victor-escenit.com,ou=People,dc=localhost,dc=com
objectClass: inetOrgPerson
objectClass: securityPrincipal
uid: victor-escenit.com
sAMAccountName: victor-escenit.com
objectSid: S-1-5-21-3650320818-366320969-327257715
cn: Víctor Zurriaga
displayName: Víctor Zurriaga
givenName: Victor
sn: Zurriaga
mail: victor@escenit.com
userPassword: password
Add new entities:
ldapadd -x -c -H ldap://localhost:389 -D "cn=Manager,dc=localhost,dc=com" -w password -f <new_file.ldif>
Search:
ldapsearch -H ldap://localhost:389 -D "cn=Manager,dc=localhost,dc=com" -w password -b dc=localhost,dc=com -s sub "(&(objectclass=inetOrgPerson)(mail=eloy@escenit.com))" "*"
cn=Manager,dc=localhost,dc=com
secret
docker pull escenitech/ldap