Make subimages compatible with late user creation

* Always remain as root during install
* Put kernel specs in system path, not user home
* Create user work directory at startup
* Note this is in 4.0 and up images, not 3.2

Contribution (c) Copyright IBM Corp. 2015
This commit is contained in:
Peter Parente
2015-08-28 22:38:13 -04:00
parent 30932a3b12
commit c4616560cf
13 changed files with 21 additions and 45 deletions

View File

@@ -1,4 +1,5 @@
#!/bin/bash
set -e
# Create non-root NB_USER, member of group "users"
useradd -m -s /bin/bash -u ${NB_UID:-1000} -G users $NB_USER
@@ -7,6 +8,11 @@ useradd -m -s /bin/bash -u ${NB_UID:-1000} -G users $NB_USER
chown -R root.users $CONDA_DIR
chmod -R g+w $CONDA_DIR
# Setup a work directory rooted in the NB_USER home
mkdir -p $WORK
chown root.users $WORK
chmod g+w $WORK
# Enable sudo if requested
if [ ! -z "$GRANT_SUDO" ]; then
echo "$NB_USER ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/notebook