From e53f1eb7d887f9343af5612e1d05b876fa18c96d Mon Sep 17 00:00:00 2001 From: Emmanuel Bruno <emmanuelbruno@users.noreply.github.com> Date: Sun, 26 Mar 2023 15:23:41 +0200 Subject: [PATCH] cleans up and add jhub for binder. --- list_packages => Artefacts/list_packages | 0 list_pip => Artefacts/list_pip | 1 + Dockerfile | 10 ++++++---- README.md | 8 ++++---- 4 files changed, 11 insertions(+), 8 deletions(-) rename list_packages => Artefacts/list_packages (100%) rename list_pip => Artefacts/list_pip (96%) diff --git a/list_packages b/Artefacts/list_packages similarity index 100% rename from list_packages rename to Artefacts/list_packages diff --git a/list_pip b/Artefacts/list_pip similarity index 96% rename from list_pip rename to Artefacts/list_pip index 8d421e0..5e17c4e 100644 --- a/list_pip +++ b/Artefacts/list_pip @@ -7,6 +7,7 @@ jupyterlab_widgets jupyterlab-code-formatter black isort +jupyterhub jupyterlab-git jupyterlab-system-monitor nbgitpuller diff --git a/Dockerfile b/Dockerfile index be2cd5a..cae60e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,18 +13,20 @@ USER root # Copy the list artefacts to install # Ubuntu and PIP packages, ... -COPY list_* /tmp/ +COPY Artefacts/ /tmp/Artefacts/ # Sets a cache for pip packages ENV PIP_CACHE_DIR=/var/cache/buildkit/pip +RUN mkdir -p $PIP_CACHE_DIR && \ + mkdir -p /var/cache/apt + # We need to remove the default `docker-clean` to avoid cache cleaning RUN --mount=type=cache,target=/var/cache/apt \ - mkdir -p $PIP_CACHE_DIR && \ rm -f /etc/apt/apt.conf.d/docker-clean && \ apt-get update && \ apt-get install -qq --yes --no-install-recommends \ - $(cat /tmp/list_packages) && \ + $(cat /tmp/Artefacts/list_packages) && \ rm -rf /var/lib/apt/lists/* # Installs only the docker client and docker compose @@ -77,7 +79,7 @@ RUN --mount=type=cache,target=${PIP_CACHE_DIR} \ --mount=type=cache,target=/opt/conda/pkgs \ echo -e "\e[93m***** Install Jupyter Lab Extensions ****\e[38;5;241m" && \ pip install --quiet --upgrade \ - $(cat /tmp/packages) && \ + $(cat /tmp/Artefacts/list_packages) && \ mamba install --quiet --yes \ nb_conda_kernels \ && \ diff --git a/README.md b/README.md index 3b9388f..6a799d1 100644 --- a/README.md +++ b/README.md @@ -10,17 +10,17 @@ A base image for the Jupyter Lab ased on jupyter/minimal-notebook : ## Quickstart ```bash -docker run --rm --name JupyterDocker-${PWD##*/} \ +docker run --rm --name jupyter-base-${PWD##*/} \ --volume data-${PWD##*/}:/home/jovyan/work/${PWD##*/} \ --publish 8888:8888 \ --env NB_UID=$UID \ brunoe/jupyter-base:develop start-notebook.sh --notebook-dir=work/${PWD##*/} ``` -## Host files and UIDs +## Host files and UIDs ```bash -docker run --rm --name JupyterDocker-${PWD##*/} \ +docker run --rm --name jupyter-base-${PWD##*/} \ --user root --volume $PWD:/home/jovyan/work/${PWD##*/} \ --volume /var/run/docker.sock:/var/run/docker.sock \ @@ -32,7 +32,7 @@ docker run --rm --name JupyterDocker-${PWD##*/} \ ## With Docker support ```bash -docker run --rm --name JupyterDocker-${PWD##*/} \ +docker run --rm --name jupyter-base-${PWD##*/} \ --user root \ --privileged=true \ --volume $PWD:/home/jovyan/work/${PWD##*/} \ -- GitLab