Files
docker-stacks/minimal-notebook/start-notebook.sh
Carl Osterwisch 7fad0c43f6 Move useradd, enable_sudo.sh, and server launch into start-notebook.sh
Provides ability to specify NB_USER and NB_UID at docker run time rather than build time.
2015-08-28 23:39:08 -04:00

20 lines
447 B
Bash
Executable File

#!/bin/bash
# Create non-root NB_USER, member of group "users"
useradd -m -s /bin/bash -u ${NB_UID:-1000} -G users $NB_USER
# Allow "users" group to update conda root env
chown -R root.users $CONDA_DIR
chmod -R g+w $CONDA_DIR
# Enable sudo if requested
if [ ! -z "$GRANT_SUDO" ]; then
echo "$NB_USER ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/notebook
fi
# Run Notebook server as $NB_USER
su -l $NB_USER << EOF
cd $WORK
jupyter notebook
EOF