Closed Karel-van-de-Plassche closed 7 years ago
@Karel-van-de-Plassche, I got it working with the following docker-compose file. Note that it doesn't using docker links, since they are superseded by networks.
version: '2'
services:
ldap-host:
image: osixia/openldap:1.1.8
networks:
mynet:
environment:
- LDAP_ORGANISATION="My Company"
- LDAP_DOMAIN=my-company.com
- LDAP_ADMIN_PASSWORD=admin
ldap-admin:
image: osixia/phpldapadmin:0.6.12
networks:
mynet:
ports:
- "6080:80"
environment:
- PHPLDAPADMIN_LDAP_HOSTS=ldap-host
- PHPLDAPADMIN_HTTPS=false
networks:
mynet:
driver: bridge
ipam:
config:
- subnet: 172.31.0.0/16
gateway: 172.31.0.1
Thanks for this workaround. In the end, I worked around it by creating my own image. Somehow then it works with the default docker-compose network.
For all those poor souls that end up here alongside myself - the issue in this case (or at least what it was for me) was that you should NOT use quotation marks when defining the ENV variable PHPLDAPADMIN_LDAP_HOSTS
Example (from first compose file snippet):
In my case it was the host computer firewall. The two docker container (openldap and phpldapadmin) can ping each other, but can not see any other port. Turning off firewall solved this problem. (Better is you configure firewall)
Using the following docker-compose file, I cannot log in on the phpLDAPadmin page:
Gives errors:
When I log into
phpldapadmin-service
usingand install ldap-utils, I can connect to the ldap-host correctly:
Also, starting the containers using
docker run
works correctly: