The image is using alpine linux as its base image. The Dockerfile is based on the work on [dinkel/docker-openldap](https://github.com/dinkel/docker-openldap) and [danielguerra69/docker-openldap](https://github.com/danielguerra69/docker-openldap)
NOTE: On purpose, there is no secured channel (TLS/SSL), because I believe that this service should never be exposed to the internet, but only be used directly by other Docker containers using the `--link` option.
To get the full potential this image offers, one should first create a data-only container (see "Data persistence" below), start the OpenLDAP daemon as follows:
For the first run, one has to set at least the first two environment variables. After the first start of the image (and the initial configuration), these envirnonment variables are not evaluated again.
*`SLAPD_DOMAIN` (required) - sets the DC (Domain component) parts. E.g. if one sets it to `ldap.example.org`, the generated base DC parts would be `...,dc=ldap,dc=example,dc=org`.
*`SLAPD_ADDITIONAL_SCHEMAS` - loads additional schemas provided in the `slapd` package that are not installed using the environment variable with comma-separated enties. As of writing these instructions, there are the following additional schemas available: `collective`, `corba`, `cosine`, `duaconf`, `dyngroup`, `inetorgperson`, `java`, `misc`, `nis`, `openldap`, `pmi` and `ppolicy`.
*`SLAPD_ADDITIONAL_MODULES` - comma-separated list of modules to load. It will try to run `.ldif` files with a corresponsing name from the `module` directory. Currently only `memberof` and `ppolicy` are avaliable.
The ppolicy module provides enhanced password management capabilities that are applied to non-rootdn bind attempts in OpenLDAP. In order to it, one has to load both the schema `ppolicy` and the module `ppolicy`:
*`SLAPD_PPOLICY_DN_PREFIX` - (defaults to `cn=default,ou=policies`) sets the dn prefix used in `modules/ppolicy.ldif` for the `olcPPolicyDefault` attribute. The value used for `olcPPolicyDefault` is derived from `$SLAPD_PPOLICY_DN_PREFIX,(dc component parts from $SLAPD_DOMAIN)`.
After loading the module, you have to load a default password policy, assuming you are on a host that has the client side tools installed (maybe you have to change the hostname as well):
The image exposes two directories (`VOLUME ["/etc/openldap/slapd.d", "/var/lib/openldap/openldap-data"]`). The first holds the "static" configuration while the second holds the actual database. Please make sure that these two directories are saved (in a data-only container or alike) in order to make sure that everything is restored after a restart of the container.