Enable the custom entrypoint script support added in #1964 to be run as root. #2039
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In #1964, the scripts were executed as $user by run_as, but for example, new packages could not be added with apt because they lacked root privileges.
Therefore, I have made changes to ensure that the custom scripts are executed with root privileges.
Also, as pointed out in the comments at #r1191243057, I have made sure that the custom scripts are executed with
/bin/bash
, even when they do not have execution permissions.For example, when using a custom script in a k8s configmap, it is not possible to assign execution permissions, and chmod cannot be used because it is mounted as ReadOnly. There are cases where it is difficult to assign execution permissions, even when you want to add a custom script.
Ideally, I wanted to do
. script
(sourcing) like in docker-library/postgres#452, but sinceentrypoint.sh
is executed with/bin/sh
, I decided to launch a new/bin/bash
shell and execute it for the sake of extensibility.Additionally, for cases where you want to execute as the nextcloud user, I've made it so that you can reference:
inside the custom script with:
My apologies for any awkward English as I am not a native speaker.
Best Regards.