[GH-ISSUE #63] Need help with docker compose #28

Closed
opened 2026-02-27 08:14:44 +03:00 by kerem · 4 comments
Owner

Originally created by @andy47 on GitHub (Oct 20, 2021).
Original GitHub issue: https://github.com/lldap/lldap/issues/63

Hi, I'm trying to work out what I'm doing wrong. I'm trying to run under docker using a slightly modified version of the example docker-compose.yml file from the project readme. The only real change is that I'm trying to map data to a sub-directory of the working directory that holds my docker-compose file so that I can define my own environment variable settings. But when I run docker-compose up I get this traceback;

Starting lldap_lldap_1 ... done
Attaching to lldap_lldap_1
lldap_1  | Error: Could not write the generated server setup to file `/data/private_key`
lldap_1  |
lldap_1  | Caused by:
lldap_1  |     Permission denied (os error 13)
lldap_lldap_1 exited with code 1

So it looks like the container can't write to my lldata directory but I can't figure out why. Can anyone help out with suggestions?

My docker-compose.yml file is as follows. I've just starred out the secret and password valuesservices:

lldap:
  image: nitnelave/lldap
  ports:
    # For LDAP
    - "3890:3890"
    # For the web front-end
    - "17170:17170"
  volumes:
    - "./lldata:/data"
  environment:
    - JWT_SECRET=*******
    - LDAP_USER_PASS=********
    - LDAP_BASE_DN=dc=home,dc=arpa
Originally created by @andy47 on GitHub (Oct 20, 2021). Original GitHub issue: https://github.com/lldap/lldap/issues/63 Hi, I'm trying to work out what I'm doing wrong. I'm trying to run under docker using a slightly modified version of the example docker-compose.yml file from the project readme. The only real change is that I'm trying to map `data` to a sub-directory of the working directory that holds my docker-compose file so that I can define my own environment variable settings. But when I run `docker-compose up` I get this traceback; Starting lldap_lldap_1 ... done Attaching to lldap_lldap_1 lldap_1 | Error: Could not write the generated server setup to file `/data/private_key` lldap_1 | lldap_1 | Caused by: lldap_1 | Permission denied (os error 13) lldap_lldap_1 exited with code 1 So it looks like the container can't write to my `lldata` directory but I can't figure out why. Can anyone help out with suggestions? My `docker-compose.yml` file is as follows. I've just starred out the secret and password valuesservices: lldap: image: nitnelave/lldap ports: # For LDAP - "3890:3890" # For the web front-end - "17170:17170" volumes: - "./lldata:/data" environment: - JWT_SECRET=******* - LDAP_USER_PASS=******** - LDAP_BASE_DN=dc=home,dc=arpa
kerem closed this issue 2026-02-27 08:14:45 +03:00
Author
Owner

@andy47 commented on GitHub (Oct 20, 2021):

And as soon as I posted this issue I figured out what I was doing wrong. I had copied lldap_config.docker_template.toml to my lldata directory and renamed it to lldap_config.toml but hadn't updated the entries that referred to the \data directory so on startup the code was trying to write to non-existent files.

<!-- gh-comment-id:947381404 --> @andy47 commented on GitHub (Oct 20, 2021): And as soon as I posted this issue I figured out what I was doing wrong. I had copied `lldap_config.docker_template.toml` to my `lldata` directory and renamed it to `lldap_config.toml` but hadn't updated the entries that referred to the `\data` directory so on startup the code was trying to write to non-existent files.
Author
Owner

@andy47 commented on GitHub (Oct 20, 2021):

Sorry, I spoke too soon. I was expecting the database and associated files to be written to my lldata folder but nothing is appearing there. The sample docker-compose file creates a named volume but I can't then figure out how to get my lldap_config.toml file into that volume. So, my question is how do I mount the container /data to a host folder so that on startup lldap will read my lldap_config.toml file. Thanks in advance for any assistance.

<!-- gh-comment-id:947386064 --> @andy47 commented on GitHub (Oct 20, 2021): Sorry, I spoke too soon. I was expecting the database and associated files to be written to my `lldata` folder but nothing is appearing there. The sample docker-compose file creates a named volume but I can't then figure out how to get my `lldap_config.toml` file into that volume. So, my question is how do I mount the container `/data` to a host folder so that on startup lldap will read my `lldap_config.toml` file. Thanks in advance for any assistance.
Author
Owner

@nitnelave commented on GitHub (Oct 20, 2021):

I just pushed a freshly baked new docker image just for you, with slightly better diagnostics when starting the server, please try it out.

With your docker-compose file above, you should have in your lldata folder the lldap_config.toml file. When the server starts, it will create the users.db file next to it.

Note that env variables should be prefixed with LLDAP_, I'll correct the README example.

<!-- gh-comment-id:947389231 --> @nitnelave commented on GitHub (Oct 20, 2021): I just pushed a freshly baked new docker image just for you, with slightly better diagnostics when starting the server, please try it out. With your docker-compose file above, you should have in your `lldata` folder the `lldap_config.toml` file. When the server starts, it will create the users.db file next to it. Note that env variables should be prefixed with `LLDAP_`, I'll correct the README example.
Author
Owner

@nitnelave commented on GitHub (Oct 28, 2021):

@andy47 Did you manage to get it working?

<!-- gh-comment-id:953916727 --> @nitnelave commented on GitHub (Oct 28, 2021): @andy47 Did you manage to get it working?
Sign in to join this conversation.
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/lldap-lldap#28
No description provided.