[GH-ISSUE #238] Cannot install with docker #84

Closed
opened 2026-02-27 08:15:08 +03:00 by kerem · 8 comments
Owner

Originally created by @Pablohn26 on GitHub (Jul 12, 2022).
Original GitHub issue: https://github.com/lldap/lldap/issues/238

When I am trying to install with docker I get the following error:

~/test/lldap$ sudo docker-compose up
[+] Running 1/0
 ⠿ Container lldap-lldap-1  Created                                                                                                                                                                   0.0s
Attaching to lldap-lldap-1
lldap-lldap-1  | [entrypoint] The /data folder doesn't exist or cannot be written to. Make sure to mount
lldap-lldap-1  |   a volume or folder to /data to persist data across restarts, and that the current user can
lldap-lldap-1  |   write to it.
lldap-lldap-1 exited with code 1

my main folder contains the following folder and files:

~/test/lldap$ tree 
.
├── docker-compose.yml
└── lldap_data
    └── lldap_config.toml

and I have tried using a volume ( - "lldap_data:/data") and using a local folder ( - "./lldap_data:/data")

Environment

OS: Ubuntu 20.04.4 LTS
Docker Compose version v2.6.1

Originally created by @Pablohn26 on GitHub (Jul 12, 2022). Original GitHub issue: https://github.com/lldap/lldap/issues/238 When I am trying to install with docker I get the following error: ``` ~/test/lldap$ sudo docker-compose up [+] Running 1/0 ⠿ Container lldap-lldap-1 Created 0.0s Attaching to lldap-lldap-1 lldap-lldap-1 | [entrypoint] The /data folder doesn't exist or cannot be written to. Make sure to mount lldap-lldap-1 | a volume or folder to /data to persist data across restarts, and that the current user can lldap-lldap-1 | write to it. lldap-lldap-1 exited with code 1 ``` my main folder contains the following folder and files: ``` ~/test/lldap$ tree . ├── docker-compose.yml └── lldap_data └── lldap_config.toml ``` and I have tried using a volume (` - "lldap_data:/data"`) and using a local folder (` - "./lldap_data:/data" `) ## Environment OS: Ubuntu 20.04.4 LTS Docker Compose version v2.6.1
kerem 2026-02-27 08:15:08 +03:00
Author
Owner

@Pablohn26 commented on GitHub (Jul 12, 2022):

I make it work using a local folder and running

sudo chmod 777 lldap_data/

Maybe there is a permission problem when running docker-compose using sudo.

How could we make it work using a volume?

<!-- gh-comment-id:1181936227 --> @Pablohn26 commented on GitHub (Jul 12, 2022): I make it work using a local folder and running > sudo chmod 777 lldap_data/ Maybe there is a permission problem when running docker-compose using `sudo`. How could we make it work using a volume?
Author
Owner

@nitnelave commented on GitHub (Jul 12, 2022):

I think that should help: https://serverfault.com/questions/984578/change-permissions-for-named-volumes-in-docker

<!-- gh-comment-id:1181982470 --> @nitnelave commented on GitHub (Jul 12, 2022): I think that should help: https://serverfault.com/questions/984578/change-permissions-for-named-volumes-in-docker
Author
Owner

@nitnelave commented on GitHub (Jul 15, 2022):

Did that work for you?

<!-- gh-comment-id:1185329784 --> @nitnelave commented on GitHub (Jul 15, 2022): Did that work for you?
Author
Owner

@philskents commented on GitHub (Jul 20, 2022):

I am getting the same issue with no sudo.

The issue is resolved if I set user to 0:0

UPDATE: I think I may have a fix, I am testing a new dockerfile locally and I will open a PR if it works

<!-- gh-comment-id:1189741018 --> @philskents commented on GitHub (Jul 20, 2022): I am getting the same issue with no sudo. The issue is resolved if I set user to 0:0 UPDATE: I think I may have a fix, I am testing a new dockerfile locally and I will open a PR if it works
Author
Owner

@nitnelave commented on GitHub (Aug 2, 2022):

Any news here?

<!-- gh-comment-id:1202779564 --> @nitnelave commented on GitHub (Aug 2, 2022): Any news here?
Author
Owner

@Pablohn26 commented on GitHub (Aug 4, 2022):

I think that should help: https://serverfault.com/questions/984578/change-permissions-for-named-volumes-in-docker

I would go with option 1 if possible, rather than launching commands to fix permissions.

@philskents did your fix work?

<!-- gh-comment-id:1204916682 --> @Pablohn26 commented on GitHub (Aug 4, 2022): > I think that should help: https://serverfault.com/questions/984578/change-permissions-for-named-volumes-in-docker I would go with option 1 if possible, rather than launching commands to fix permissions. @philskents did your fix work?
Author
Owner

@martadinata666 commented on GitHub (Aug 4, 2022):

Start from scratch should fix this, as the build already fix volume permission, and set /data path permission correctly. If there is volume left kindly remove it first then recreate the container. if this :stable tag then it still need manually create path user 1000:1000 is the default, otherwise specifiy user: ####:####

version: '3'
services:
  lldap:
    image: nitnelave/lldap:stable
    # Change this to the user:group you want.
#    user: 1000:1000 #must match permission with the `/path/to/data`
    ports:
      # For LDAP
      - "3890:3890"
      # For the web front-end
      - "17170:17170"
    volumes:
      - "/path/to/data:/data"
    environment:
      - LLDAP_JWT_SECRET=REPLACE_WITH_RANDOM
      - LLDAP_LDAP_USER_PASS=REPLACE_WITH_PASSWORD
      - LLDAP_LDAP_BASE_DN=dc=example,dc=com%  
<!-- gh-comment-id:1204994699 --> @martadinata666 commented on GitHub (Aug 4, 2022): Start from scratch should fix this, as the build already fix volume permission, and set `/data` path permission correctly. If there is volume left kindly remove it first then recreate the container. if this `:stable` tag then it still need manually create `path` user 1000:1000 is the default, otherwise specifiy `user: ####:####` ``` version: '3' services: lldap: image: nitnelave/lldap:stable # Change this to the user:group you want. # user: 1000:1000 #must match permission with the `/path/to/data` ports: # For LDAP - "3890:3890" # For the web front-end - "17170:17170" volumes: - "/path/to/data:/data" environment: - LLDAP_JWT_SECRET=REPLACE_WITH_RANDOM - LLDAP_LDAP_USER_PASS=REPLACE_WITH_PASSWORD - LLDAP_LDAP_BASE_DN=dc=example,dc=com% ```
Author
Owner

@nitnelave commented on GitHub (Nov 10, 2022):

I think the issue was solved.

<!-- gh-comment-id:1310057316 --> @nitnelave commented on GitHub (Nov 10, 2022): I think the issue was solved.
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#84
No description provided.