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
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 \
curl \
less \
vim \
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
ENV CODESERVEREXT_DIR /opt/codeserver/extensions
ENV CODE_WORKINGDIR $HOME/work
ENV CODESERVERDATA_DIR $HOME/work/codeserver/data
ENV CODESERVERDATA_DIR $HOME/work/.codeserver/data
ENV PATH=/opt/bin:$PATH
# Enable persistant conda env
COPY condarc /home/jovyan/.condarc
# Instalk JupyterLab
RUN echo -e "\e[93m***** Install Jupyter Lab Extensions ****\e[38;5;241m" && \
# Install JupyterLab
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 \
jupyter-book \
jupyter-server-proxy \
......@@ -29,7 +43,8 @@ RUN echo -e "\e[93m***** Install Jupyter Lab Extensions ****\e[38;5;241m" && \
jupyterlab-git \
jupyterlab-system-monitor \
jinja-yaml-magic \
ipympl && \
# ipympl \
&& \
jupyter labextension install @jupyter-widgets/jupyterlab-manager && \
# pip 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" && \
tectonic texlab chktex && \
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 && \
mkdir -p $CODESERVERDATA_DIR &&\
mkdir -p $CODESERVEREXT_DIR && \
PATH=/opt/bin:$PATH code-server \
--user-data-dir $CODESERVERDATA_DIR\
......@@ -58,9 +74,9 @@ RUN echo -e "\e[93m***** Install Jupyter Lab Extensions ****\e[38;5;241m" && \
chmod 770 -R $CODESERVEREXT_DIR && \
adduser "$NB_USER" codeserver && \
echo -e "\e[93m**** Clean up ****\e[38;5;241m" && \
npm cache clean --force && \
mamba clean --all -f -y && \
jupyter lab clean && \
# npm cache clean --force && \
# mamba clean --all -f -y && \
# jupyter lab clean && \
rm -rf "/home/${NB_USER}/.cache/yarn" && \
fix-permissions "$CONDA_DIR" && \
fix-permissions "/home/$NB_USER"
......
......@@ -3,9 +3,10 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
. ${DIR}/env.sh
docker build \
#DOCKER_BUILDKIT=1 docker build \
docker buildx build \
--file Dockerfile \
-t ${BASE}:$SHA \
`[[ "$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
if [ ! -f $dir ]; then
echo Creating $dir
mkdir -p $dir
chmod 700 $dir
fix-permissions $dir
# chmod 700 $dir
fi
done
......@@ -15,6 +16,7 @@ for subfile in $NEEDED_WORK_FILES; do
if [ ! -f $file ]; then
echo Creating $file
touch $file
chmod 700 $dir
fix-permissions $file
# chmod 700 $dir
fi
done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment