[GH-ISSUE #393] Remove Hardcoded Volume #149

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

Originally created by @RedlineTriad on GitHub (Dec 11, 2022).
Original GitHub issue: https://github.com/lldap/lldap/issues/393

The LLDAP docker images include hardcoded volume paths.
Which means that if you don't want to mount all of /data then it will create an anonymous volume which is very annoying when deploying.

In general I don't think VOLUME should be used in Dockerfiles, since there is no way to change it afterwards.
In my case I want lldap_config.toml to be mounted read only to the local file system, and then use /data/dynamic for storing the database.
docker-compose.yml

    volumes:
      - lldap_data:/data/dynamic
      - ./lldap_config.toml:/data/lldap_config.toml:ro

I can work around this by using a different directory for the database or config file, but it's still a bit cumbersome.

Originally created by @RedlineTriad on GitHub (Dec 11, 2022). Original GitHub issue: https://github.com/lldap/lldap/issues/393 The LLDAP docker images include hardcoded volume paths. Which means that if you don't want to mount all of `/data` then it will create an anonymous volume which is very annoying when deploying. In general I don't think `VOLUME` should be used in Dockerfiles, since there is no way to change it afterwards. In my case I want `lldap_config.toml` to be mounted read only to the local file system, and then use `/data/dynamic` for storing the database. `docker-compose.yml` ```yml volumes: - lldap_data:/data/dynamic - ./lldap_config.toml:/data/lldap_config.toml:ro ``` I can work around this by using a different directory for the database or config file, but it's still a bit cumbersome.
kerem 2026-02-27 08:15:32 +03:00
Author
Owner

@nitnelave commented on GitHub (Dec 11, 2022):

I'm not sure I understand all of your concerns.
What prevents you from mounting all of /data, but then on top of it mount
the config readonly?

The dockerfile is primarily made for ease of use. For a new user, using the
image is the easiest. If you're an advanced user with a non standard use
case, that's also supported: we provide the dockerfile, you can either
modify it and build your own image, or build in top of it.

I'd rather not modify the standard image since it would require people to
migrate their docker compose configuration.

On Sun, 11 Dec 2022, 14:16 RedlineTriad, @.***> wrote:

The LLDAP docker images include hardcoded volume paths.
Which means that if you don't want to mount all of /data then it will
create an anonymous volume which is very annoying when deploying.

In general I don't think VOLUME should be used in Dockerfiles, since
there is no way to change it afterwards.
In my case I want lldap_config.toml to be mounted read only to the local
file system, and then use /data/dynamic for storing the database.
docker-compose.yml

volumes:
  - lldap_data:/data/dynamic
  - ./lldap_config.toml:/data/lldap_config.toml:ro

I can work around this by using a different directory for the database or
config file, but it's still a bit cumbersome.


Reply to this email directly, view it on GitHub
https://github.com/nitnelave/lldap/issues/393, or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAGCPWMQ46K7FP7XARKR3CDWMXH2LANCNFSM6AAAAAAS27AABU
.
You are receiving this because you are subscribed to this thread.Message
ID: @.***>

<!-- gh-comment-id:1345576911 --> @nitnelave commented on GitHub (Dec 11, 2022): I'm not sure I understand all of your concerns. What prevents you from mounting all of /data, but then on top of it mount the config readonly? The dockerfile is primarily made for ease of use. For a new user, using the image is the easiest. If you're an advanced user with a non standard use case, that's also supported: we provide the dockerfile, you can either modify it and build your own image, or build in top of it. I'd rather not modify the standard image since it would require people to migrate their docker compose configuration. On Sun, 11 Dec 2022, 14:16 RedlineTriad, ***@***.***> wrote: > The LLDAP docker images include hardcoded volume paths. > Which means that if you don't want to mount all of /data then it will > create an anonymous volume which is very annoying when deploying. > > In general I don't think VOLUME should be used in Dockerfiles, since > there is no way to change it afterwards. > In my case I want lldap_config.toml to be mounted read only to the local > file system, and then use /data/dynamic for storing the database. > docker-compose.yml > > volumes: > - lldap_data:/data/dynamic > - ./lldap_config.toml:/data/lldap_config.toml:ro > > I can work around this by using a different directory for the database or > config file, but it's still a bit cumbersome. > > — > Reply to this email directly, view it on GitHub > <https://github.com/nitnelave/lldap/issues/393>, or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AAGCPWMQ46K7FP7XARKR3CDWMXH2LANCNFSM6AAAAAAS27AABU> > . > You are receiving this because you are subscribed to this thread.Message > ID: ***@***.***> >
Author
Owner

@RedlineTriad commented on GitHub (Dec 11, 2022):

If you create a volume in Dockerfile there has to be a volume there no matter what.
If you don't mount it, it creates an anonymous volume, there is no way to disable or block this.
Even if you only want to mount a sub-path, or not entirely, for a temporary test instance, it will still create it.

If you don't think any of this is important it's fine if you close this issue since I have my own workaround now.

<!-- gh-comment-id:1345660781 --> @RedlineTriad commented on GitHub (Dec 11, 2022): If you create a volume in `Dockerfile` there *has* to be a volume there no matter what. If you don't mount it, it creates an anonymous volume, there is no way to disable or block this. Even if you only want to mount a sub-path, or not entirely, for a temporary test instance, it will still create it. If you don't think any of this is important it's fine if you close this issue since I have my own workaround now.
Author
Owner

@nitnelave commented on GitHub (Dec 21, 2022):

I think for most people it's fine to have an (almost empty) volume, even if it's not used. Those who know better can make their own Dockerfile and image.

<!-- gh-comment-id:1361233265 --> @nitnelave commented on GitHub (Dec 21, 2022): I think for most people it's fine to have an (almost empty) volume, even if it's not used. Those who know better can make their own Dockerfile and image.
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#149
No description provided.