Set group=users on home and conda dir

This commit is contained in:
Peter Parente
2015-09-12 20:04:48 -04:00
parent 69c5c35f7f
commit 0c508efe4e
2 changed files with 4 additions and 6 deletions

View File

@@ -34,7 +34,6 @@ ENV NB_UID 1000
# Install conda
RUN mkdir -p $CONDA_DIR && \
chmod g+s $CONDA_DIR && \
echo export PATH=$CONDA_DIR/bin:'$PATH' > /etc/profile.d/conda.sh && \
wget --quiet https://repo.continuum.io/miniconda/Miniconda3-3.9.1-Linux-x86_64.sh && \
/bin/bash /Miniconda3-3.9.1-Linux-x86_64.sh -f -b -p $CONDA_DIR && \
@@ -50,12 +49,11 @@ RUN conda install --yes \
# Create jovyan user with UID=1000 and in the 'users' group
# Grant ownership over the conda dir and home dir, but stick the group as root.
RUN useradd -m -s /bin/bash -N -u $NB_UID $NB_USER && \
chmod g+s /home/$NB_USER && \
mkdir /home/$NB_USER/work && \
mkdir /home/$NB_USER/.jupyter && \
mkdir /home/$NB_USER/.local && \
chown -R $NB_USER:root $CONDA_DIR && \
chown -R $NB_USER:root /home/$NB_USER
chown -R $NB_USER:users $CONDA_DIR && \
chown -R $NB_USER:users /home/$NB_USER
# Configure container startup
EXPOSE 8888
@@ -65,4 +63,4 @@ CMD [ "start-notebook.sh" ]
COPY start-notebook.sh /usr/local/bin/
COPY notebook.conf /etc/supervisor/conf.d/
COPY jupyter_notebook_config.py /home/$NB_USER/.jupyter/
RUN chown -R $NB_USER:root /home/$NB_USER/.jupyter
RUN chown -R $NB_USER:users /home/$NB_USER/.jupyter

View File

@@ -3,7 +3,7 @@
# 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
chown -R $NB_UID $CONDA_DIR
fi
# Enable sudo if requested