-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.v8
More file actions
76 lines (62 loc) · 2.97 KB
/
Dockerfile.v8
File metadata and controls
76 lines (62 loc) · 2.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Start from Python 3.12.7 image
FROM python:3.12.7
# System update
RUN apt update && \
apt upgrade -y && \
apt install -y \
git xorg openbox \
software-properties-common openssl wget \
net-tools default-jre default-jdk time curl gcc g++ build-essential \
bison flex \
libcairo2-dev libcurl4-openssl-dev libssl-dev libxt-dev libtool libharfbuzz-dev libfribidi-dev libpng-dev \
libtiff5-dev libjpeg-dev libfreetype6 libfreetype-dev libhdf5-dev libxml2-dev libreadline-dev \
libx11-dev libbz2-dev liblzma-dev libpcre2-dev \
zlib1g-dev xorg-dev \
gfortran texinfo texlive \
pixz pigz pbzip2
# Define R version
ENV R_VERSION=4.4.3
# Download and build R from source (needed before installing rpy2 with python)
RUN wget https://cran.r-project.org/src/base/R-4/R-${R_VERSION}.tar.gz && \
tar -xzf R-${R_VERSION}.tar.gz && \
cd R-${R_VERSION} && \
./configure --enable-R-shlib --with-blas --with-lapack && \
make -j$(nproc) && \
make install && \
cd .. && rm -rf R-${R_VERSION} R-${R_VERSION}.tar.gz
RUN R --version
# Upgrade pip and install Python packages
RUN python -m pip install --no-cache-dir --upgrade pip==24.3.1 setuptools==75.7.0 wheel==0.45.1 cmake==3.14.3 && \
python -m pip install --no-cache-dir --upgrade leidenalg==0.10.2 texttable==1.7.0 igraph==0.11.8 MulticoreTSNE==0.1 anndata==0.11.1 array-api-compat==1.10.0 cffi==1.17.1 click==8.1.8 contourpy==1.3.1 cycler==0.12.1 fonttools==4.55.3 h5py==3.12.1 joblib==1.4.2 kiwisolver==1.4.8 legacy-api-wrap==1.4.1 llvmlite==0.43.0 loompy==3.0.7 matplotlib==3.10.0 natsort==8.4.0 networkx==3.4.2 numba==0.60.0 numpy==2.0.2 numpy-groupies==0.11.2 packaging==24.2 pandas==2.2.3 patsy==1.0.1 pillow==11.1.0 pycparser==2.22 pynndescent==0.5.13 pyparsing==3.2.1 python-dateutil==2.9.0.post0 pytz==2024.2 scanpy==1.10.4 scikit-learn==1.6.0 scipy==1.15.0 seaborn==0.13.2 session-info==1.0.0 six==1.17.0 statsmodels==0.14.4 stdlib_list==0.11.0 threadpoolctl==3.5.0 tqdm==4.67.1 tzdata==2024.2 umap-learn==0.5.7 rpy2==3.6.4
# Define R *.so library paths (for rpy2 to find R libraries)
ENV LD_LIBRARY_PATH=/usr/local/lib/R/lib:$LD_LIBRARY_PATH
# Remove warning message when importing rimport with rpy2
RUN sed -i '1210,1214 s/^/##/' /usr/local/lib/python3.12/site-packages/rpy2/rinterface/__init__.py
# Install R packages
COPY R/packages/install_packages.v8.R /tmp/install_packages.v8.R
COPY R/packages/*.tar.gz /tmp/
RUN Rscript /tmp/install_packages.v8.R
RUN rm /tmp/install_packages.v8.R
RUN rm /tmp/*.tar.gz
# Copy data to image
COPY R/*.R /srv
COPY python/*.py /srv
COPY java/bin/*.jar /srv
COPY bin/* /srv
# Set permissions
RUN chmod -R 755 /srv
# User
ENV USER=rvmuser USER_ID=1006 USER_GID=1006
# now creating user NO NEED IN LAST INSTALL
RUN groupadd --gid "${USER_GID}" "${USER}" && \
useradd \
--uid ${USER_ID} \
--gid ${USER_GID} \
--create-home \
--shell /bin/bash \
${USER}
USER ${USER}
# Maintainer
LABEL maintainer="Fabrice P.A. David <fabrice.david@epfl.ch>"
# Working directory
WORKDIR /srv