Been working on this all afternoon, Im hoping I have something obviously misconfigured. I got it to work once and then on a restart I get this error when slapd tries to start and I havent been able to make it go away except by manual intervention.
version: '2.0'
services:
ldap:
image: osixia/openldap:1.2.0
container_name: openldap
restart: always
command: --loglevel trace --copy-service
volumes:
- ./ldap/ldif:/container/service/slapd/assets/config/bootstrap/ldif/custom
- ./ldap/slapd/database:/var/lib/ldap
- ./ldap/slapd/config:/etc/ldap/slapd.d
environment:
LDAP_ADMIN_PASSWORD: "admin"
LDAP_ORGANISATION: "Redhat Inc."
LDAP_DOMAIN: "redhat.com"
LDAP_TLS: "false"
LDAP_TLS_ENFORCE: "false"
LDAP_TLS_VERIFY_CLIENT: "never"
LDAP_REMOVE_CONFIG_AFTER_SETUP: "false"
LDAP_BACKEND: "hdb"
hostname: ldap.redhat.com
ports:
- "127.0.0.1:389:389"
- "127.0.0.1:636:636"
openldap_slapd_failed_to_start_1_debug.txt
openldap_slapd_failed_to_start_2_trace.txt
openldap_slapd_failed_to_start_3_trace_manual_start.txt
openldap_slapd_failed_to_start_4_docker_info.txt
Things I've tried:
>docker exec -it 3308e177dd1b bash
slapd -h 'ldap://ldap ldap://localhost ldapi:///' -u openldap -g openldap -d 256
5aa1a38e daemon: bind(9) failed errno=99 (Cannot assign requested address)
5aa1a38f slapd starting
5aa1a38f daemon: listen(ldap://ldap, 5) failed errno=98 (Address already in use)
5aa1a38f slapd stopped.
so it fails in the interactive shell but over in the running docker-compose shell I see openldap_slapd_failed_to_start_3_trace_manual_start.txt (look after all the sleeps while I was connecint bash and executing the slapd command). So it appears to work, though i haven't spent much time verifying functionality. Its complaining about my ldif syntax for some reason.
What am I doing wrong?
The issue seems to come from container hostname. I will investigate on that.
Thanks for reporting this issue.
yeah looks like if I remove hostname altogether it works
I鈥榤 having the same problem, but in my case removing the hostname doesn鈥檛 resolve the issue, but leads to another issue, that slapd can鈥檛 bind to the desired address.
I鈥榤 running the container with an existing LDAP database and config from a previous installation. If I run a shell inside the container and start the slapd service manually, there is no problem and I can query the LDAP.
Can鈥檛 edit my previous comment, since I鈥檓 on mobile, but the error suddenly disappeared.
Anyone got this to work? I cannot get it work even after removing host name.
I confirm that I have the same problem when I'm using a fully qualified hostname or a domainname (but ok, with a simple hostname like 'ldap' without any domainname).
I have the same problem.. and I could see that in my /etc/hosts had two lines for the same hostname.
I put all in one line and works!
thanks men!
I also ran into this problem only when specifying a docker config domainname.
I was able to workaround this by overwriting the entrypoint to specify the arg to not mess with the /etc/hosts file, i.e:
ENTRYPOINT ["/container/tool/run", "--dont-touch-etc-hosts"]
Options are here: https://github.com/osixia/docker-light-baseimage/blob/807519dc9ec668f3df8ebe5d273e7f1ec4b9fa2b/image/tool/run#L841
Hi - I commented domainname and hostname and got it working.
Most helpful comment
I confirm that I have the same problem when I'm using a fully qualified hostname or a domainname (but ok, with a simple hostname like 'ldap' without any domainname).