Use NB_UID for USER statement in Dockerfile so deployment platform can verify that image doesn't run as root.

This commit is contained in:
Graham Dumpleton
2018-02-15 11:11:32 +11:00
parent c54800018c
commit 770007bb10
8 changed files with 11 additions and 11 deletions

View File

@@ -53,7 +53,7 @@ RUN useradd -m -s /bin/bash -N -u $NB_UID $NB_USER && \
fix-permissions $HOME && \
fix-permissions $CONDA_DIR
USER $NB_USER
USER $NB_UID
# Setup work directory for backward-compatibility
RUN mkdir /home/$NB_USER/work && \
@@ -101,4 +101,4 @@ COPY jupyter_notebook_config.py /etc/jupyter/
RUN fix-permissions /etc/jupyter/
# Switch back to jovyan to avoid accidental container runs as root
USER $NB_USER
USER $NB_UID

View File

@@ -55,7 +55,7 @@ RUN useradd -m -s /bin/bash -N -u $NB_UID $NB_USER && \
mkdir -p $CONDA_DIR && \
chown $NB_USER $CONDA_DIR
USER $NB_USER
USER $NB_UID
# Setup jovyan home directory
RUN mkdir /home/$NB_USER/work && \
@@ -98,4 +98,4 @@ COPY jupyter_notebook_config.py /home/$NB_USER/.jupyter/
RUN chown -R $NB_USER:users /home/$NB_USER/.jupyter
# Switch back to jovyan to avoid accidental container runs as root
USER $NB_USER
USER $NB_UID