mirror of
https://github.com/ChristianLight/tutor.git
synced 2025-02-02 17:38:25 +00:00
Fix running dev openedx image with sudo
When running with `sudo`, the USERID image ARG is 0. The docker entrypoint needed to take this case into account. See: https://discuss.overhang.io/t/openedx-is-not-the-name-of-a-known-user/224/5
This commit is contained in:
parent
2ee5b49841
commit
25f98250cb
@ -4,6 +4,7 @@ Note: Breaking changes between versions are indicated by "💥".
|
||||
|
||||
## Unreleased
|
||||
|
||||
- [Bugfix] Fix running dev image with `sudo`
|
||||
- [Improvement] Add `cms/lms-env-features` patches (#276)
|
||||
- [Feature] Add plugin subcommands
|
||||
- 💥[Improvement] Move ``-r/--root`` option to parent command level
|
||||
|
@ -1,10 +1,16 @@
|
||||
#!/bin/sh -e
|
||||
export DJANGO_SETTINGS_MODULE=$SERVICE_VARIANT.envs.$SETTINGS
|
||||
|
||||
# Change file permissions of mounted volumes
|
||||
echo "Setting file permissions..."
|
||||
find /openedx -not -path "/openedx/edx-platform/*" -not -user openedx -exec chown openedx:openedx {} \+
|
||||
echo "File permissions set."
|
||||
if id -u openedx > /dev/null 2>&1; then
|
||||
# Change file permissions of mounted volumes
|
||||
echo "Setting file permissions for user openedx..."
|
||||
find /openedx -not -path "/openedx/edx-platform/*" -not -user openedx -exec chown openedx:openedx {} \+
|
||||
echo "File permissions set."
|
||||
|
||||
# Run CMD as user openedx
|
||||
exec chroot --userspec="$openedx:openedx" --skip-chdir / env HOME=/openedx "$@"
|
||||
else
|
||||
echo "Running openedx-dev as root user"
|
||||
exec "$@"
|
||||
fi
|
||||
|
||||
# Run CMD as user openedx
|
||||
exec chroot --userspec="$openedx:openedx" --skip-chdir / env HOME=/openedx "$@"
|
Loading…
x
Reference in New Issue
Block a user