mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-17 23:12:56 +00:00
use groups for managing write-access to files
- any files the user should be able to write should have group `user-permissions` with `g+rwX` - remove `chown` from start.sh because it is no longer needed - add `fix-permissions` script for setting the user-writable permissions on a path - user-permissions group as GID 10000 (is there a reason for it to have a different value?) - containers can set group with `--group-add user-writable` if they want to run with a different uid/gid (without -u root -e NB_UID -e NB_GID, which make this unnecessary)
This commit is contained in:
@@ -13,14 +13,6 @@ if [ $(id -u) == 0 ] ; then
|
||||
if [ "$NB_UID" != $(id -u $NB_USER) ] ; then
|
||||
echo "Set user UID to: $NB_UID"
|
||||
usermod -u $NB_UID $NB_USER
|
||||
# Careful: $HOME might resolve to /root depending on how the
|
||||
# container is started. Use the $NB_USER home path explicitly.
|
||||
for d in "$CONDA_DIR" "$JULIA_PKGDIR" "/home/$NB_USER"; do
|
||||
if [[ ! -z "$d" && -d "$d" ]]; then
|
||||
echo "Set ownership to uid $NB_UID: $d"
|
||||
chown -R $NB_UID "$d"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# Change GID of NB_USER to NB_GID if NB_GID is passed as a parameter
|
||||
|
Reference in New Issue
Block a user