Files
docker-stacks/minimal-kernel/start-notebook.sh
Michael Poplavski eafec9ac7f Updated to reduce image size of minimal kernel
Contribution (c) Copyright IBM Corp. 2016
2016-01-11 14:28:50 -06:00

16 lines
372 B
Bash

#!/bin/bash
# Change UID of NB_USER to NB_UID if it does not match
if [ "$NB_UID" != $(id -u $NB_USER) ] ; then
usermod -u $NB_UID $NB_USER
fi
# Enable sudo if requested
if [ ! -z "$GRANT_SUDO" ]; then
echo "$NB_USER ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/notebook
fi
# Start the notebook server
exec su $NB_USER -c "env PATH=$PATH jupyter kernelgateway $@"