Files
docker-stacks/minimal-notebook/start-notebook.sh
Peter Parente dba9977525 Create jovyan in Dockerfile, reset UID at startup
* Create user jovyan with UID=1000 in the default users group in the Dockerfile
* Set group ownership of user home and conda to root to avoid 'users' group from host access when mounted
* Set stick bit on both paths so root owns subdirs too
* Change jovyan UID if NB_UID is specified and is not the default 1000

Contribution (c) Copyright IBM Corp. 2015
2015-09-10 23:46:31 -04:00

16 lines
414 B
Bash
Executable File

#!/bin/bash
# Change UID of jovyan to NB_UID if it does not match
if [ "$NB_UID" != $(id -u jovyan) ] ; then
usermod -u $NB_UID $NB_USER
chown -R $NB_UID:$NB_UID $CONDA_DIR
fi
# Enable sudo if requested
if [ ! -z "$GRANT_SUDO" ]; then
echo "$NB_USER ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/notebook
fi
# Start supervisord in foreground, PID1
exec supervisord -n -c /etc/supervisor/supervisord.conf