[GH-ISSUE #7] Use with TestContainers, localhost and custom ldif file #6

Closed
opened 2026-02-27 16:47:37 +03:00 by kerem · 2 comments
Owner

Originally created by @l0rinc on GitHub (Aug 19, 2019).
Original GitHub issue: https://github.com/rroemhild/docker-test-openldap/issues/7

Hey,

I've tried a few alternative dockerized ldap images, this one is actually working out of the box with an planetexpress.com -> localhost mapping in /etc/hosts.
Is there a better way to be able to use this from TestContainers with localhost?
And is there a convenient way to load our own ldif, instead of the provided one?

Thanks!

Originally created by @l0rinc on GitHub (Aug 19, 2019). Original GitHub issue: https://github.com/rroemhild/docker-test-openldap/issues/7 Hey, I've tried a few alternative dockerized ldap images, this one is actually working out of the box with an `planetexpress.com` -> `localhost` mapping in `/etc/hosts`. Is there a better way to be able to use this from TestContainers with `localhost`? And is there a convenient way to load our own `ldif`, instead of the provided one? Thanks!
kerem closed this issue 2026-02-27 16:47:37 +03:00
Author
Owner

@rroemhild commented on GitHub (Sep 9, 2019):

Hi, not sure about the /etc/hosts mapping, in the past I do not need to map the hostname to access the container from localhost or remote hosts.

And to answer your second question, there is no convenient way to load own ldif files. The initial idea for this docker image was to have a fix LDAP setup to run test against it. Maybe that's why it working out of the box 😄

<!-- gh-comment-id:529387721 --> @rroemhild commented on GitHub (Sep 9, 2019): Hi, not sure about the `/etc/hosts` mapping, in the past I do not need to map the hostname to access the container from localhost or remote hosts. And to answer your second question, there is no convenient way to load own ldif files. The initial idea for this docker image was to have a fix LDAP setup to run test against it. Maybe that's why it working out of the box :smile:
Author
Owner

@SamyOteroGlez commented on GitHub (Oct 9, 2019):

You could donwload/clone the repo and add your own .ldif files under bootstrap/data/, then start (rebuild) the container.

I am using docker-compose and following the same ldap structure proposed here. Check below my docker-compose file, just place it on the root of the project.

version: '2'

services:
    ldap:
        container_name: ldap
        # image: rroemhild/test-openldap
        build:
            context: ./
            dockerfile: ./Dockerfile
        ports:
            - '11389:389'
            - '11636:636'
        volumes:
            - data_volume:/var/lib/ldap/
        networks:
            - app_default

volumes:
    data_volume:

networks:
    app_default:
        external:
            name: app_default

Then you could add more users using something like Apache Directory Studio, but if you rebuild/destroy the container the new users will be lost, unless you add them via .ldif files described above.

Cheers

<!-- gh-comment-id:540119439 --> @SamyOteroGlez commented on GitHub (Oct 9, 2019): You could donwload/clone the repo and add your own .ldif files under `bootstrap/data/`, then start (rebuild) the container. I am using docker-compose and following the same ldap structure proposed here. Check below my `docker-compose` file, just place it on the root of the project. ``` version: '2' services: ldap: container_name: ldap # image: rroemhild/test-openldap build: context: ./ dockerfile: ./Dockerfile ports: - '11389:389' - '11636:636' volumes: - data_volume:/var/lib/ldap/ networks: - app_default volumes: data_volume: networks: app_default: external: name: app_default ``` Then you could add more users using something like `Apache Directory Studio`, but if you rebuild/destroy the container the new users will be lost, unless you add them via `.ldif` files described above. Cheers
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/docker-test-openldap#6
No description provided.