Last active
July 29, 2023 09:17
-
-
Save tabrez/7c84f2f6d8764e33d79fbcd99050ecf5 to your computer and use it in GitHub Desktop.
Dockerfile to build Jupyter Lab container with fastai support
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ARG OWNER=tabrez | |
ARG BASE_CONTAINER=jupyter/base-notebook | |
FROM $BASE_CONTAINER | |
LABEL maintainer="Tabrez Iqbal <tabrez@mailbox.org>" | |
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | |
USER root | |
RUN apt-get update --yes \ | |
&& apt-get install --yes --no-install-recommends \ | |
build-essential \ | |
git \ | |
&& apt-get clean \ | |
&& rm -rf /var/lib/apt/lists/* | |
USER ${NB_UID} | |
RUN jupyter labextension disable "@jupyterlab/apputils-extension:announcements" | |
RUN mamba install --yes -c conda-forge --freeze-installed \ | |
numpy \ | |
matplotlib-base \ | |
pandas \ | |
ipywidgets \ | |
sentencepiece \ | |
nbdev \ | |
jupyterlab-autosave-on-focus-change \ | |
nbdime \ | |
&& mamba clean --all -f -y \ | |
&& npm cache clean --force \ | |
&& find /opt/conda/ -follow -type f -name '*.a' -delete \ | |
&& find /opt/conda/ -follow -type f -name '*.pyc' -delete \ | |
&& find /opt/conda/ -follow -type f -name '*.js.map' -delete \ | |
&& find /opt/conda/lib/python*/site-packages/bokeh/server/static -follow -type f -name '*.js' ! -name '*.min.js' -delete | |
# RUN nbdime config-git --enable --global | |
RUN mamba install --yes --freeze-installed \ | |
pytorch \ | |
torchvision \ | |
torchaudio \ | |
pytorch-cuda=11.7 -c pytorch -c nvidia \ | |
&& mamba clean --all -f -y \ | |
&& npm cache clean --force \ | |
&& find /opt/conda/ -follow -type f -name '*.a' -delete \ | |
&& find /opt/conda/ -follow -type f -name '*.pyc' -delete \ | |
&& find /opt/conda/ -follow -type f -name '*.js.map' -delete \ | |
&& find /opt/conda/lib/python*/site-packages/bokeh/server/static -follow -type f -name '*.js' ! -name '*.min.js' -delete | |
RUN mamba install --yes --freeze-installed \ | |
fastbook -c fastchan \ | |
&& mamba clean --all -f -y \ | |
&& npm cache clean --force \ | |
&& find /opt/conda/ -follow -type f -name '*.a' -delete \ | |
&& find /opt/conda/ -follow -type f -name '*.pyc' -delete \ | |
&& find /opt/conda/ -follow -type f -name '*.js.map' -delete \ | |
&& find /opt/conda/lib/python*/site-packages/bokeh/server/static -follow -type f -name '*.js' ! -name '*.min.js' -delete \ | |
# && fix-permissions "${CONDA_DIR}" \ | |
&& fix-permissions "/home/${NB_USER}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment