Skip to content

Instantly share code, notes, and snippets.

@informationsea
Last active February 29, 2024 15:57
Show Gist options
  • Save informationsea/ee5127613813398bdad89f3968a1c0d7 to your computer and use it in GitHub Desktop.
Save informationsea/ee5127613813398bdad89f3968a1c0d7 to your computer and use it in GitHub Desktop.
Jupyter Notebook Docker
FROM almalinux:9 as download
RUN dnf update -y && dnf install --allowerasing -y wget curl
ARG PYTHON_VERSION=3.11.8
RUN wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz
RUN tar xzf Python-${PYTHON_VERSION}.tgz
FROM almalinux:9 as build
RUN dnf update -y && dnf install -y epel-release && crb enable && dnf update -y
RUN dnf install --allowerasing -y gcc gcc-c++ make autoconf automake bzip2-devel zlib-devel xz-devel ncurses-devel libcurl-devel openssl-devel tcl-devel tk-devel sqlite-devel readline-devel libffi-devel gdbm-devel
WORKDIR /build
ARG PYTHON_VERSION=3.11.8
COPY --from=download /Python-${PYTHON_VERSION} /build/Python-${PYTHON_VERSION}
WORKDIR /build/Python-${PYTHON_VERSION}
ENV PATH="/opt/python3/3.11/bin:${PATH}"
RUN ./configure --enable-optimizations --enable-shared --prefix=/opt/python3/3.11 && make -j4 && make install
FROM almalinux:9
RUN dnf update -y && dnf install -y epel-release && crb enable && dnf update -y
RUN dnf install --allowerasing -y gcc gcc-c++ make autoconf automake bzip2-devel zlib-devel xz-devel ncurses-devel libcurl-devel openssl-devel tcl-devel tk-devel sqlite-devel readline-devel libffi-devel gdbm-devel
RUN dnf install -y zlib bzip2 bzip2-libs xz ncurses openssl tcl tk sqlite readline libffi atlas-devel openblas blas lapack gcc-gfortran
RUN dnf install -y R ruby
RUN dnf install --allowerasing -y bzip2-devel xz-devel zlib-devel libcurl-devel \
openssl-devel tcl-devel tk-devel sqlite-devel readline-devel libffi-devel \
texinfo file diffutils libX11-devel libXt-devel libpng-devel cairo-devel \
libtiff-devel libicu-devel pcre2-devel java-21-openjdk-devel libxml2-devel \
hdf5-devel harfbuzz-devel fribidi-devel udunits2-devel proj-devel libjpeg-turbo-devel
RUN curl -fsSL https://rpm.nodesource.com/setup_lts.x | bash - && yum install -y nodejs
COPY --from=build /opt/python3/3.11 /opt/python3/3.11
ENV PATH="/opt/python3/3.11/bin:${PATH}"
ENV LD_LIBRARY_PATH="/opt/python3/3.11/lib:/opt/python3/3.11/lib64"
RUN pip3 install --upgrade pip wheel
RUN pip3 install \
biopython scipy cython pyfaidx pysam vcfpy flask jinja2 numpy scipy \
pyliftover pygments requests csvkit nose toml mypy flake8 openpyxl pyexcel \
intervaltree pylint cwltool matplotlib virtualenv cyvcf2 pyyaml jsonschema \
seaborn psycopg2-binary simplevcf yapf scikit-learn pyjwt python-jose attrs bidict plotnine \
sphinx furo click toml paramiko opencv-python "polars[all]" diffusers transformers ftfy \
blaze dask dash pygal pillow apache-airflow-client xgboost nltk \
polyglot mininet pyright "python-lsp-server[all]" pylsp-mypy pyls-isort "python-language-server[all]" \
pandas tensorflow xformer \
types-requests coala code2flow prospector vulture black pyre-check types-six MonkeyType pytype \
jupyterlab voila
RUN pip3 install jupyter-book notebook jupyterhub bash_kernel
RUN python3 -m bash_kernel.install
RUN npm install -g ijavascript && ijsinstall
COPY install.R /tmp/install.R
RUN Rscript /tmp/install.R
RUN ln -s /etc/ssl/certs/ca-bundle.crt /etc/ssl/certs/ca-certificates.crt
RUN useradd -m -s /bin/bash jupyter
COPY install2.R /tmp/install2.R
RUN dnf install -y ruby ruby-devel make zeromq-devel rubygem-rake
# ARG RSTUDIO_VERSION=2023.12.1-402
# WORKDIR /tmp
# RUN curl -OL https://download2.rstudio.org/server/rhel9/x86_64/rstudio-server-rhel-${RSTUDIO_VERSION}-x86_64.rpm
# RUN dnf install -y rstudio-server-rhel-${RSTUDIO_VERSION}-x86_64.rpm
USER jupyter
WORKDIR /home/jupyter
RUN curl -fsSL https://install.julialang.org > /tmp/julia-install.sh && bash /tmp/julia-install.sh -y
RUN source ~/.bashrc && julia -e 'using Pkg; Pkg.add("IJulia")'
RUN ijsinstall && python3 -m bash_kernel.install
RUN Rscript /tmp/install2.R
ENV PATH="/home/jupyter/bin:${PATH}"
RUN gem install --user-install iruby && iruby register --force
RUN curl -fsSL https://deno.land/install.sh | sh
ENV DENO_INSTALL="/home/jupyter/.deno"
ENV PATH="$DENO_INSTALL/bin:$PATH"
RUN deno jupyter --unstable --install
CMD ["jupyter", "lab", "--ip=0.0.0.0"]
options(repos="http://cran.rstudio.com/")
install.packages(c("devtools", "tidyverse"))
library(devtools)
devtools::install_github("melff/RKernel/pkg")
RKernel::installspec()
RKernel::installspec()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment