Skip to content
Snippets Groups Projects
Commit 6eec4d5f authored by Emmanuel Bruno's avatar Emmanuel Bruno
Browse files

fixes user access rights.

parent e03b9034
No related branches found
No related tags found
No related merge requests found
FROM jupyter/scipy-notebook:2021-10-20 #FROM jupyter/scipy-notebook:2022-10-24
FROM jupyter/scipy-notebook:lab-3.5.0
USER root USER root
RUN apt-get update --yes && apt-get install --yes --no-install-recommends \ ENV PIP_CACHE_DIR=/var/cache/buildkit/pip
RUN --mount=type=cache,target=/var/cache/apt \
rm -f /etc/apt/apt.conf.d/docker-clean &&\
mkdir -p $PIP_CACHE_DIR &&\
apt-get update --yes && apt-get install --yes -qq --no-install-recommends \
bash \ bash \
curl \ curl \
less \ less \
vim \ vim \
zip && \ zip && \
apt-get clean && rm -rf /var/lib/apt/lists/* && rm -rf /var/cache/apt rm -rf /var/lib/apt/lists/*
# Sets Defaults directories
ENV WORK_DIR $HOME/work
ENV NOTEBOOKS_DIR $WORK_DIR/notebooks
ENV SAMPLES_DIR $WORK_DIR/samples
# Sets codeserver directories # Sets codeserver directories
ENV CODESERVEREXT_DIR /opt/codeserver/extensions ENV CODESERVEREXT_DIR /opt/codeserver/extensions
ENV CODE_WORKINGDIR $HOME/work ENV CODE_WORKINGDIR $HOME/work
ENV CODESERVERDATA_DIR $HOME/work/codeserver/data ENV CODESERVERDATA_DIR $HOME/work/.codeserver/data
ENV PATH=/opt/bin:$PATH ENV PATH=/opt/bin:$PATH
# Enable persistant conda env # Enable persistant conda env
COPY condarc /home/jovyan/.condarc COPY condarc /home/jovyan/.condarc
# Instalk JupyterLab # Install JupyterLab
RUN echo -e "\e[93m***** Install Jupyter Lab Extensions ****\e[38;5;241m" && \ RUN --mount=type=cache,target=/var/cache/buildkit/pip \
--mount=type=cache,target=/opt/conda/pkgs \
echo -e "\e[93m***** Install Jupyter Lab Extensions ****\e[38;5;241m" && \
pip install --quiet --no-cache-dir --upgrade \ pip install --quiet --no-cache-dir --upgrade \
jupyter-book \ jupyter-book \
jupyter-server-proxy \ jupyter-server-proxy \
...@@ -29,7 +43,8 @@ RUN echo -e "\e[93m***** Install Jupyter Lab Extensions ****\e[38;5;241m" && \ ...@@ -29,7 +43,8 @@ RUN echo -e "\e[93m***** Install Jupyter Lab Extensions ****\e[38;5;241m" && \
jupyterlab-git \ jupyterlab-git \
jupyterlab-system-monitor \ jupyterlab-system-monitor \
jinja-yaml-magic \ jinja-yaml-magic \
ipympl && \ # ipympl \
&& \
jupyter labextension install @jupyter-widgets/jupyterlab-manager && \ jupyter labextension install @jupyter-widgets/jupyterlab-manager && \
# pip install jupyterlab_templates && \ # pip install jupyterlab_templates && \
# jupyter labextension install jupyterlab_templates && \ # jupyter labextension install jupyterlab_templates && \
...@@ -42,6 +57,7 @@ RUN echo -e "\e[93m***** Install Jupyter Lab Extensions ****\e[38;5;241m" && \ ...@@ -42,6 +57,7 @@ RUN echo -e "\e[93m***** Install Jupyter Lab Extensions ****\e[38;5;241m" && \
tectonic texlab chktex && \ tectonic texlab chktex && \
echo -e "\e[93m**** Installs Code Server Web ****\e[38;5;241m" && \ echo -e "\e[93m**** Installs Code Server Web ****\e[38;5;241m" && \
curl -fsSL https://code-server.dev/install.sh | sh -s -- --prefix=/opt --method=standalone && \ curl -fsSL https://code-server.dev/install.sh | sh -s -- --prefix=/opt --method=standalone && \
mkdir -p $CODESERVERDATA_DIR &&\
mkdir -p $CODESERVEREXT_DIR && \ mkdir -p $CODESERVEREXT_DIR && \
PATH=/opt/bin:$PATH code-server \ PATH=/opt/bin:$PATH code-server \
--user-data-dir $CODESERVERDATA_DIR\ --user-data-dir $CODESERVERDATA_DIR\
...@@ -58,9 +74,9 @@ RUN echo -e "\e[93m***** Install Jupyter Lab Extensions ****\e[38;5;241m" && \ ...@@ -58,9 +74,9 @@ RUN echo -e "\e[93m***** Install Jupyter Lab Extensions ****\e[38;5;241m" && \
chmod 770 -R $CODESERVEREXT_DIR && \ chmod 770 -R $CODESERVEREXT_DIR && \
adduser "$NB_USER" codeserver && \ adduser "$NB_USER" codeserver && \
echo -e "\e[93m**** Clean up ****\e[38;5;241m" && \ echo -e "\e[93m**** Clean up ****\e[38;5;241m" && \
npm cache clean --force && \ # npm cache clean --force && \
mamba clean --all -f -y && \ # mamba clean --all -f -y && \
jupyter lab clean && \ # jupyter lab clean && \
rm -rf "/home/${NB_USER}/.cache/yarn" && \ rm -rf "/home/${NB_USER}/.cache/yarn" && \
fix-permissions "$CONDA_DIR" && \ fix-permissions "$CONDA_DIR" && \
fix-permissions "/home/$NB_USER" fix-permissions "/home/$NB_USER"
......
...@@ -3,9 +3,10 @@ ...@@ -3,9 +3,10 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
. ${DIR}/env.sh . ${DIR}/env.sh
docker build \ #DOCKER_BUILDKIT=1 docker build \
docker buildx build \
--file Dockerfile \ --file Dockerfile \
-t ${BASE}:$SHA \ -t ${BASE}:$SHA \
`[[ "$BRANCH" != "master" ]] && echo -t ${BASE}:$BRANCH` \ `[[ "$BRANCH" != "master" ]] && echo -t ${BASE}:$BRANCH` \
`[[ "$BRANCH" == "master" ]] && echo -t ${BASE}:latest` \ `[[ "$BRANCH" == "master" ]] && echo -t ${BASE}:latest` $@ \
. .
...@@ -5,7 +5,8 @@ for subdir in $NEEDED_WORK_DIRS; do ...@@ -5,7 +5,8 @@ for subdir in $NEEDED_WORK_DIRS; do
if [ ! -f $dir ]; then if [ ! -f $dir ]; then
echo Creating $dir echo Creating $dir
mkdir -p $dir mkdir -p $dir
chmod 700 $dir fix-permissions $dir
# chmod 700 $dir
fi fi
done done
...@@ -15,6 +16,7 @@ for subfile in $NEEDED_WORK_FILES; do ...@@ -15,6 +16,7 @@ for subfile in $NEEDED_WORK_FILES; do
if [ ! -f $file ]; then if [ ! -f $file ]; then
echo Creating $file echo Creating $file
touch $file touch $file
chmod 700 $dir fix-permissions $file
# chmod 700 $dir
fi fi
done done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment