mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-17 15:02:57 +00:00
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:
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user