[GH-ISSUE #936] Bootrap.sh seems not executable #345

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

Originally created by @flashpixx on GitHub (Jul 22, 2024).
Original GitHub issue: https://github.com/lldap/lldap/issues/936

Describe the bug
I'm try to run the boostrap.sh as init container on K8 and follow the the documentation https://github.com/lldap/lldap/blob/main/example_configs/bootstrap/bootstrap.md

To Reproduce

Try to run docker run lldap/lldap:2024-07-20-alpine /bootstrap/bootstrap.sh or I'm using /app/bootstrap.sh
The output is:

entrypoint] Copying the default config to /data/lldap_config.toml
[entrypoint] Edit this file to configure LLDAP.
> Setup permissions..
> Starting lldap..

error: unrecognized subcommand '/bootstrap/bootstrap.sh'

Usage: lldap <COMMAND>

For more information, try '--help'.

so it seems that the script could not be executed

Expected behavior
Executing the boostrap script to add user and groups

Originally created by @flashpixx on GitHub (Jul 22, 2024). Original GitHub issue: https://github.com/lldap/lldap/issues/936 **Describe the bug** I'm try to run the `boostrap.sh` as init container on K8 and follow the the documentation https://github.com/lldap/lldap/blob/main/example_configs/bootstrap/bootstrap.md **To Reproduce** Try to run `docker run lldap/lldap:2024-07-20-alpine /bootstrap/bootstrap.sh` or I'm using `/app/bootstrap.sh` The output is: ``` entrypoint] Copying the default config to /data/lldap_config.toml [entrypoint] Edit this file to configure LLDAP. > Setup permissions.. > Starting lldap.. error: unrecognized subcommand '/bootstrap/bootstrap.sh' Usage: lldap <COMMAND> For more information, try '--help'. ``` so it seems that the script could not be executed **Expected behavior** Executing the boostrap script to add user and groups
kerem 2026-02-27 08:16:47 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@nitnelave commented on GitHub (Jul 22, 2024):

The way you're invoking docker run just passes the bootstrap path to the LLDAP startup script (which expects an lldap command like "run").

What you want is to call the bootstrap instead of the LLDAP startup script, by changing the entry point of the container:
docker run lldap/lldap:2024-07-20-alpine --entrypoint /bootstrap/bootstrap.sh

<!-- gh-comment-id:2242734180 --> @nitnelave commented on GitHub (Jul 22, 2024): The way you're invoking docker run just passes the bootstrap path to the LLDAP startup script (which expects an lldap command like "run"). What you want is to call the bootstrap instead of the LLDAP startup script, by changing the entry point of the container: `docker run lldap/lldap:2024-07-20-alpine --entrypoint /bootstrap/bootstrap.sh`
Author
Owner

@flashpixx commented on GitHub (Jul 22, 2024):

The correct command seems to be:

 docker run --entrypoint /app/bootstrap.sh lldap/lldap:2024-07-20-alpine

But I'm not sure that it is posible to overwrite the entrypoint in a pod setup within Kubernetes, inmho I overwrite the command, see the docs https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/
It would be nice to run the boostrap script on an init container, and if the pod security is activated so it seems to to be possible to install other tools within the container.

Maybe a solution could be to extend the docker-entrypoint.sh with an option flag --bootstrap to execute the bootstrapping and install the tools per default

But in general great work, I will use it for a data science project as central auth structure e.g. for Airflow, Jupyter, Spark etc

<!-- gh-comment-id:2243024194 --> @flashpixx commented on GitHub (Jul 22, 2024): The correct command seems to be: ``` docker run --entrypoint /app/bootstrap.sh lldap/lldap:2024-07-20-alpine ``` But I'm not sure that it is posible to overwrite the entrypoint in a pod setup within Kubernetes, inmho I overwrite the command, see the docs https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/ It would be nice to run the boostrap script on an init container, and if the pod security is activated so it seems to to be possible to install other tools within the container. Maybe a solution could be to extend the `docker-entrypoint.sh` with an option flag `--bootstrap` to execute the bootstrapping and install the tools per default But in general great work, I will use it for a data science project as central auth structure e.g. for Airflow, Jupyter, Spark etc
Author
Owner

@nitnelave commented on GitHub (Jul 22, 2024):

I'm not very familiar with Kubernetes, so I didn't follow all your answer.

Is there anything I can help with?

<!-- gh-comment-id:2243061852 --> @nitnelave commented on GitHub (Jul 22, 2024): I'm not very familiar with Kubernetes, so I didn't follow all your answer. Is there anything I can help with?
Author
Owner

@flashpixx commented on GitHub (Jul 22, 2024):

I think it is useful to change the docker-entrypoint.sh script, but you have got a basic Kubernetes config, but a Helm Chart would be nice.
I'm using LLDAP at the moment and I can make a fork for your project to create a Helm Chart. Can I send a pull request for a full Helm Chart to this repo with also changes on the shell-scripts / Dockerfiles etc, but it will take some time

<!-- gh-comment-id:2243196963 --> @flashpixx commented on GitHub (Jul 22, 2024): I think it is useful to change the `docker-entrypoint.sh` script, but you have got a basic [Kubernetes config](https://github.com/lldap/lldap?tab=readme-ov-file#with-kubernetes), but a [Helm Chart](https://helm.sh/) would be nice. I'm using LLDAP at the moment and I can make a fork for your project to create a Helm Chart. Can I send a pull request for a full Helm Chart to this repo with also changes on the shell-scripts / Dockerfiles etc, but it will take some time
Author
Owner

@nitnelave commented on GitHub (Jul 22, 2024):

There's already a helm chart with bootstrap support (unofficial): https://artifacthub.io/packages/helm/djjudas21/lldap

<!-- gh-comment-id:2243360863 --> @nitnelave commented on GitHub (Jul 22, 2024): There's already a helm chart with bootstrap support (unofficial): https://artifacthub.io/packages/helm/djjudas21/lldap
Author
Owner

@flashpixx commented on GitHub (Jul 22, 2024):

Thanks this is nice

<!-- gh-comment-id:2243397775 --> @flashpixx commented on GitHub (Jul 22, 2024): Thanks this is nice
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#345
No description provided.