osixia / docker-openldap

OpenLDAP container image 🐳🌴
MIT License
4.05k stars 978 forks source link

Cannot connect to LDAP server from a client javax.naming.CommunicationException #260

Open chaminikumara opened 6 years ago

chaminikumara commented 6 years ago

Follows the steps I did

  1. Run ldap on docker docker run --name my-openldap-container --detach osixia/openldap:1.2.2

  2. To test the image 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 gives the response which mentioned in the readme file.

  3. To find what listens on what port in terminal lsof -nP -i4TCP:389 | grep LISTEN This command results nothing

  4. Docker ps results as follows osixia/openldap:1.2.2 "/container/tool/run" 34 minutes ago Up 34 minutes 389/tcp, 636/tcp my-openldap-container

  5. I try to connect from LDAP client (Jxplorer-3.3.1.2) and gives following error Host: localhost Port:389 with default admin password javax.naming.CommunicationException: localhost:389 [Root exception is java.net.ConnectException: Connection refused (Connection refused)]

richthedev commented 5 years ago

As stated in the documentation, you have to map the ports: docker run -p 389:389 -p 689:689 --name my-openldap-container --detach osixia/openldap:1.2.2