mirror of
https://github.com/ChristianLight/tutor.git
synced 2024-12-12 06:07:56 +00:00
Fix dev user creation when running root on host
This commit is contained in:
parent
5e9d405a91
commit
a2cb012e65
@ -10,15 +10,14 @@ RUN apt update && \
|
||||
RUN pip install -r requirements/edx/development.txt
|
||||
RUN pip install ipdb==0.12.2 ipython==5.8.0
|
||||
|
||||
# Configure new user
|
||||
ARG USERID=1000
|
||||
RUN useradd --home-dir /openedx --uid $USERID openedx
|
||||
RUN chown -R openedx:openedx /openedx
|
||||
|
||||
# Copy new entrypoint (to take care of permission issues at runtime)
|
||||
COPY ./bin /openedx/bin
|
||||
RUN chmod a+x /openedx/bin/*
|
||||
|
||||
# Configure new user
|
||||
ARG USERID=1000
|
||||
RUN create-user.sh $USERID
|
||||
|
||||
# Default django settings
|
||||
ENV SETTINGS tutor.development
|
||||
|
||||
|
11
tutor/templates/build/openedx-dev/bin/create-user.sh
Executable file
11
tutor/templates/build/openedx-dev/bin/create-user.sh
Executable file
@ -0,0 +1,11 @@
|
||||
#! /bin/sh -e
|
||||
USERID=$1
|
||||
|
||||
if [ "$USERID" != "" ] && [ "$USERID" != "0" ]
|
||||
then
|
||||
echo "Creating 'openedx' user with id $USERID"
|
||||
useradd --home-dir /openedx --uid $USERID openedx
|
||||
chown -R openedx:openedx /openedx
|
||||
else
|
||||
echo "Running as root"
|
||||
fi
|
Loading…
Reference in New Issue
Block a user