#!/bin/bash # ================================================================== # Initial setup # ------------------------------------------------------------------ # Ubuntu 20.04 as base image FROM ubuntu:20.04 RUN yes| unminimize # Set ENV variables ENV LANG C.UTF-8 ENV SHELL=/bin/bash ENV DEBIAN_FRONTEND=noninteractive ENV APT_INSTALL="apt-get install -y --no-install-recommends" ENV PIP_INSTALL="python3 -m pip --no-cache-dir install --upgrade" ENV GIT_CLONE="git clone --depth 10" # ================================================================== # Tools # ------------------------------------------------------------------ RUN apt-get update && \ $APT_INSTALL \ apt-utils \ gcc \ make \ pkg-config \ apt-transport-https \ build-essential \ ca-certificates \ wget \ rsync \ git \ vim \ mlocate \ libssl-dev \ curl \ openssh-client \ unzip \ unrar \ zip \ csvkit \ emacs \ joe \ jq \ dialog \ man-db \ manpages \ manpages-dev \ manpages-posix \ manpages-posix-dev \ nano \ iputils-ping \ sudo \ ffmpeg \ libsm6 \ libxext6 \ libboost-all-dev \ cifs-utils \ software-properties-common # ================================================================== # Python # ------------------------------------------------------------------ #Based on https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa # Adding repository for python3.11 RUN add-apt-repository ppa:deadsnakes/ppa -y && \ # Installing python3.11 $APT_INSTALL \ python3.11 \ python3.11-dev \ python3.11-venv \ python3-distutils-extra # Add symlink so python and python3 commands use same python3.9 executable RUN ln -s /usr/bin/python3.11 /usr/local/bin/python3 && \ ln -s /usr/bin/python3.11 /usr/local/bin/python # Installing pip RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11 ENV PATH=$PATH:/root/.local/bin # ================================================================== # PyTorch # ------------------------------------------------------------------ # Based on https://pytorch.org/get-started/locally/ RUN $PIP_INSTALL torch torchvision torchaudio torchtext && \ # ================================================================== # TensorFlow # ------------------------------------------------------------------ # Based on https://www.tensorflow.org/install/pip $PIP_INSTALL tensorflow && \ # ================================================================== # Hugging Face # ------------------------------------------------------------------ # Based on https://huggingface.co/docs/transformers/installation # Based on https://huggingface.co/docs/datasets/installation $PIP_INSTALL datasets && \ # ================================================================== # JupyterLab # ------------------------------------------------------------------ # Based on https://jupyterlab.readthedocs.io/en/stable/getting_started/installation.html#pip $PIP_INSTALL jupyterlab==3.4.6 && \ # ================================================================== # Additional Python Packages # ------------------------------------------------------------------ $PIP_INSTALL \ numpy==1.23.4 \ scipy==1.9.2 \ pandas==1.5.0 \ cloudpickle==2.2.0 \ scikit-image \ matplotlib==3.6.1 \ ipython==8.5.0 \ ipykernel==6.16.0 \ ipywidgets==8.0.2 \ cython==0.29.32 \ tqdm==4.64.1 \ gdown \ xgboost==1.6.2 \ pillow==9.2.0 \ seaborn==0.12.0 \ sqlalchemy==1.4.41 \ spacy==3.4.1 \ nltk==3.7 \ boto3==1.24.90 \ tabulate==0.9.0 \ future==0.18.2 \ gradient==2.0.6 \ jsonify==0.5 \ opencv-python==4.6.0.66 \ sentence-transformers==2.2.2 \ wandb==0.13.4 \ awscli==1.25.91 \ jupyterlab-snippets==0.4.1 \ tornado==6.1 # ================================================================== # Installing transformers & scikit image (fixed) # ------------------------------------------------------------------ RUN pip install -U git+https://github.com/huggingface/transformers RUN pip install --pre scikit-learn # ================================================================== # Installing JRE and JDK # ------------------------------------------------------------------ RUN $APT_INSTALL \ default-jre \ default-jdk # ================================================================== # CMake # ------------------------------------------------------------------ RUN $GIT_CLONE https://github.com/Kitware/CMake ~/cmake && \ cd ~/cmake && \ ./bootstrap && \ make -j"$(nproc)" install # ================================================================== # Node.js and Jupyter Notebook Extensions # ------------------------------------------------------------------ RUN curl -sL https://deb.nodesource.com/setup_16.x | bash && \ $APT_INSTALL nodejs && \ $PIP_INSTALL jupyter_contrib_nbextensions jupyterlab-git && \ jupyter contrib nbextension install --user # ================================================================== # Startup # ------------------------------------------------------------------ EXPOSE 8888 6006 CMD jupyter-lab \ --ip 0.0.0.0 \ --port 7860 \ --no-browser \ --allow-root \ --ServerApp.token="$JUPYTER_TOKEN" \ --ServerApp.tornado_settings="{'headers': {'Content-Security-Policy': 'frame-ancestors *'}}" \ --ServerApp.cookie_options="{'SameSite': 'None', 'Secure': True}" \ --ServerApp.disable_check_xsrf=True \ --LabApp.news_url=None \ --LabApp.check_for_updates_class="jupyterlab.NeverCheckForUpdate"