Docker Community Forums

Share and learn in the Docker community.

Need help to get openLDAP to run

(Uhlhorn) #1


I am new to docker and try to get a LDAP server to run. But it does not work. I do not know where my mistake is.

I do this:
(Beginning with a factory fresh setting)

First I install the LDAP container:
docker run --name test-openldap-container --detach osixia/openldap:1.1.10

Then I create new ldap server:
docker run --env LDAP_ORGANISATION=„LDAP-Test" --env LDAP_DOMAIN=“ldap.local” --detach osixia/openldap:1.1.10

I install the phpLDAPadmin container:
docker run -p 6443:443 --env PHPLDAPADMIN_LDAP_HOSTS=ldap.local --detach osixia/phpldapadmin:0.7.0

I open:

I try to log in as admin, password admin. But I get the following error:

Unable to connect to LDAP server ldap.local
Error: Can’t contact LDAP server (-1) for user
Failed to Authenticate to server
Invalid Username or Password.

(Sam) #2

did u try the quickstart from

Quick Start

Run OpenLDAP docker image:

docker run --name my-openldap-container --detach osixia/openldap:1.1.10
This start a new container with OpenLDAP running inside. Let's make the first search in our LDAP container:

docker exec my-openldap-container ldapsearch -x -H ldap://localhost -b dc=example,dc=org -D "cn=admin,dc=example,dc=org" -w admin

this is runs the image and then exec a command in the running container

this makes no sense

First I install the LDAP container:
docker run --name test-openldap-container --detach osixia/openldap:1.1.10

you don’t ‘install’ a docker container,… you might PULL it to your local system

if you say docker run … some_image and the image is not local, it will be pulled from the docker hub

your example started 3 servers… where the quickstart started 1, and USED it on the second command

(Uhlhorn) #3

Sorry, I was ill for two days.

This „no sense“ is from here:


My goal is it to start a LDAP server and the phpLDAPadmin. And the LDAP server should store his data into my Mac file system or into a second data container.

These are the two docker containers I want to use:

(Uhlhorn) #4

Okay, an other try. :slight_smile:

I found a "Full Description“, but I do not understand anything in the description:

First command:
docker run -d -p 389:389 -e SLAPD_PASSWORD=mysecretpassword -e dinkel/openldap

I want to use:
Password: testpassword01! (only for test, I do not use this password off course.)
Domain: server.local (I want to use this im my LAN)

So, I have to change the command:
docker run -d -p 389:389 -e SLAPD_PASSWORD=testpassword01! -e SLAPD_DOMAIN=server.local dinkel/openldap

Is this correct?

STEP 2, first command
The second command is:
docker run -d --volumes-from your-data-container [CONFIG] dinkel/openldap

For „your-data-container“ I would fill in ~/Documents/Docker/LDAP-Data/database/
But what do I have to fill in for [CONFIG]?!? The name of a config file? The path to a config file? Where can I find the config file? Or have I write any other thing at this place? Where can I find a documentation for [CONFIG]? Where can I find an example?

STEP 2, second comand
The third command is:
docker run -d --volume your-config-volume:/etc/ldap --volume your-data-volume:/var/lib/ldap [CONFIG] dinkel/openldap

Path to static data: ~/Documents/Docker/LDAP-Data/static/
Path to database ~/Documents/Docker/LDAP-Data/database/

I fill in my paths:
docker run -d --volume ~/Documents/Docker/LDAP-Data/static:/etc/ldap --volume ~/Documents/Docker/LDAP-Data/database:/var/lib/ldap [CONFIG] dinkel/openldap

Again: what do I have to fill in for [CONFIG]? I do not know.

STEP 2, an alternative step 2
The third command is:
docker run -d --link openldap:openldap image-using-openldap

Do I have to replace anything on this command? Perhaps image-using-openldap? Do I have to replace it with a path? And what kind of path?

Where can I find examples? Or can some one help me with an example?

(Uhlhorn) #5

Oh, I did not see:

… and start the OpenLDAP daemon in one of these ways:

So, STEP 2 to 4 is a choice and not STEP 2…4