Docker-openldap: Unable to access openldap container

Created on 30 Oct 2017  路  2Comments  路  Source: osixia/docker-openldap

Hi,

I am new to containers and openldap containers.

I started openldap with the following commands.

docker run --name my-openldap-container --detach osixia/openldap:1.1.9

and did an ldap search as Suggested in the documentation.
docker exec my-openldap-container ldapsearch -x -H ldap://localhost -b dc=example,dc=org -D "cn=admin,dc=example,dc=org" -w admin

Got the following output

LDAPv3

base with scope subtree

filter: (objectclass=*)

requesting: ALL

#

example.org

dn: dc=example,dc=org
objectClass: top
objectClass: dcObject
objectClass: organization
o: Example Inc.
dc: example

admin, example.org

dn: cn=admin,dc=example,dc=org
objectClass: simpleSecurityObject
objectClass: organizationalRole
cn: admin
description: LDAP administrator
userPassword:: e1NTSEF9QlNEZmZEVEM1YVNUNFk0NVFVL0RsZHUwcFdzZ0UwdFY=

search result

search: 2
result: 0 Success

numResponses: 3

numEntries: 2

Docker -ps result is as follows
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c9244503d4b9 osixia/openldap:1.1.9 "/container/tool/run" 2 minutes ago Up 2 minutes 389/tcp, 636/tcp my-openldap-container
[

[root@localhost ~]# netstat -atn
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 256 10.229.208.73:22 10.229.208.1:52055 ESTABLISHED
tcp6 0 0 :::111 :::* LISTEN
tcp6 0 0 :::22 :::* LISTEN
tcp6 0 0 ::1:25 :::* LISTEN

There is no process listening on 389 or 636

Docker Image question

Most helpful comment

You have to map the ports when creating the container in order to access from your host:

docker run --name my-openldap-container -p 389:389 -p 689:689 --detach osixia/openldap:1.1.9

All 2 comments

You have to map the ports when creating the container in order to access from your host:

docker run --name my-openldap-container -p 389:389 -p 689:689 --detach osixia/openldap:1.1.9

I had this exact problem, maybe put a nice notice in the README (which does include a beginner's guide, with the port argument excluded)

Was this page helpful?
0 / 5 - 0 ratings