-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added entrypoint hooks for your own custom scripts #1964
Conversation
a9ca8bc
to
4fd6e70
Compare
118ace8
to
640b78b
Compare
/rebase |
Signed-off-by: Dennis Vestergaard Værum <github@varum.dk>
- Only execute shell-scripts (mening files ending with .sh) - Sort the files before executing them, had forgotten 😅 - Added a message when a hook script finish - Added prefix arror to message to show the are related Signed-off-by: Dennis Vestergaard Værum <github@varum.dk>
Signed-off-by: Dennis Vestergaard Værum <github@varum.dk>
Co-authored-by: J0WI <J0WI@users.noreply.github.com> Signed-off-by: Dennis Værum <6872940+dvaerum@users.noreply.github.com>
Signed-off-by: Dennis Vestergaard Værum <github@varum.dk>
Signed-off-by: Dennis Vestergaard Værum <github@varum.dk>
640b78b
to
e9e834b
Compare
The build fails: |
aaahhh, that is true, I forgot that this can be a problem. If there are no files in the folder for filling the glob-criteria ( but, I will add something like this to test if the folder is empty, when I get home from work or one of their days 😁 [ -z "$(ls -A test_folder)" ] && echo "Empty" || echo "Not Empty" |
…as empty Signed-off-by: Dennis Vestergaard Værum <github@varum.dk>
Hey @J0WI, I have fixed the bug, hopefully there are no more stupid mistake 😅 will you approve the workflow? 😁 |
Thanks! |
Thank you for this feature! The log says: I have this in my Dockerfile:
Any idea? |
🤯 that is a good question 🤔 From what I can see, what you do should work. If you make a zip-file with your environment and the commands you run, I will debug it 🙂 because if you have found a bug I want to fix it |
Beginners mistake: I had This works as well: |
Awesome, happy to hear that you solved the problem :D. Furthermore, just for reference, you don't have to change the ownership as long that anyone can execute the file 😉 |
Signed-off-by: AkashiSN <btorntireinvynriy@gmail.com>
I'm trying to add some packages ( However, this is not working:
It seems that the scripts are executed with the |
First of, this was never meant to solve the problem of installing missing packages, this was meant to configure Nextcloud by running commands commands like In my opinion you should make a new image, I don’t know how you start your image, but it is pretty straightforward to make small adjustments to the image using docker-compose. But, if you want to make the changes/Install the package when the container start, you can change the entrypoint, to be something like this Hopes this helps/point you in the right direction. Also, what documentation are you missing? because I can try to add it, if you have something specific 😁 |
Thanks for the clarification. Your idea with the entryhooks works great for me.
|
* Added entrypoint hooks for your own custom scripts Signed-off-by: Dennis Vestergaard Værum <github@varum.dk> * Small changes: - Only execute shell-scripts (mening files ending with .sh) - Sort the files before executing them, had forgotten 😅 - Added a message when a hook script finish - Added prefix arror to message to show the are related Signed-off-by: Dennis Vestergaard Værum <github@varum.dk> * Show in the search msg that it only searches for '*.sh' files Signed-off-by: Dennis Vestergaard Værum <github@varum.dk> * Fixed spelling mistake Co-authored-by: J0WI <J0WI@users.noreply.github.com> Signed-off-by: Dennis Værum <6872940+dvaerum@users.noreply.github.com> * Updated the `README.md` file Signed-off-by: Dennis Vestergaard Værum <github@varum.dk> * change from using find to using a for-loop to located the `.sh` files Signed-off-by: Dennis Vestergaard Værum <github@varum.dk> * Fix bug - that would make docker-entrypoint.sh failed, hook folders was empty Signed-off-by: Dennis Vestergaard Værum <github@varum.dk> --------- Signed-off-by: Dennis Vestergaard Værum <github@varum.dk> Signed-off-by: Dennis Værum <6872940+dvaerum@users.noreply.github.com> Co-authored-by: J0WI <J0WI@users.noreply.github.com>
I what looking around to see if there was anyway to execute custom script(s) when Nextcloud is installed/initiated the first time or whenever it is upgraded.
Sadly, this feature doesn't exist, but I can see there has been talked about it in #820 (comment), and I can also see that there are 2 pull requests for adding an environment variable tell the container to install extra apps doing Nextcloud installation/initialization.
This entrypoint hooks for custom scripts would allow for people to easily add these features themselves, plus other features like "add support for oauth in docker image" (#1023)
I am open for feedback because I think this would give a lot of flexibility with the Nextcloud container 😁