FROM python:3.9-slim # install the notebook package RUN pip install --no-cache --upgrade pip && \ pip install --no-cache notebook jupyterlab # create user with a home directory ARG NB_USER ARG NB_UID ENV USER user ENV HOME /home/${USER} RUN mkdir $HOME && mkdir $HOME/app RUN adduser --disabled-password --gecos '' --shell /bin/bash user \ && chown -R user:user $HOME/app RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user USER user WORKDIR ${HOME} USER root