-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
150 lines (142 loc) · 5.04 KB
/
Dockerfile
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# lift from cmiller R docker repo
# https://github.com/chrisamiller/docker-R
# add seurat dev repo
# add python stack
# add umap
FROM ubuntu:xenial
ARG R_VERSION
ARG BUILD_DATE
ARG SEURAT_VERSION=3.1.0
ENV BUILD_DATE 2019-01-18
ENV R_VERSION=${R_VERSION:-3.5.1}
RUN apt-get update && apt-get install -y --no-install-recommends locales && \
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && \
locale-gen en_US.UTF-8 && \
LC_ALL=en_US.UTF-8 && \
LANG=en_US.UTF-8 && \
/usr/sbin/update-locale LANG=en_US.UTF-8 && \
TERM=xterm && \
apt-get install -y --no-install-recommends \
bash-completion \
ca-certificates \
file \
fonts-texgyre \
g++ \
gfortran \
gsfonts \
libbz2-1.0 \
curl \
libssl-dev \
libcurl4-openssl-dev \
libnss-sss libxml2-dev \
python3-dev \
python3-pip \
libcurl3 \
libicu55 \
libjpeg-turbo8 \
libopenblas-dev \
libpangocairo-1.0-0 \
libpcre3 \
libpng12-0 \
libtiff5 \
liblzma5 \
locales \
zlib1g \
libbz2-dev \
libcairo2-dev \
libpango1.0-dev \
libjpeg-dev \
libicu-dev \
libmariadb-client-lgpl-dev \
libmysqlclient-dev \
libpcre3-dev \
libpng-dev \
libreadline-dev \
libtiff5-dev \
liblzma-dev \
libx11-dev \
libxt-dev \
libhdf5-dev \
perl \
tcl8.5-dev \
tk8.5-dev \
texinfo \
texlive-extra-utils \
texlive-fonts-recommended \
texlive-fonts-extra \
texlive-latex-recommended \
x11proto-core-dev \
xauth \
xfonts-base \
xvfb ncurses-dev libssl-dev \
zlib1g-dev && \
cd /tmp/ && \
## Download source code
curl -O https://cran.r-project.org/src/base/R-3/R-${R_VERSION}.tar.gz && \
## Extract source code
tar -xf R-${R_VERSION}.tar.gz && \
cd R-${R_VERSION} && \
## Set compiler flags
R_PAPERSIZE=letter && \
R_BATCHSAVE="--no-save --no-restore" && \
R_BROWSER=xdg-open && \
PAGER=/usr/bin/pager && \
PERL=/usr/bin/perl && \
R_UNZIPCMD=/usr/bin/unzip && \
R_ZIPCMD=/usr/bin/zip && \
R_PRINTCMD=/usr/bin/lpr && \
LIBnn=lib && \
AWK=/usr/bin/awk && \
CFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g" && \
CXXFLAGS="-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g" && \
## Configure options
./configure --enable-R-shlib \
--enable-memory-profiling \
--with-readline \
--with-blas="-lopenblas" \
--disable-nls \
--without-recommended-packages && \
## Build and install
make && \
make install && \
## Add a default CRAN mirror
echo "options(repos = c(CRAN = 'https://cran.rstudio.com/'), download.file.method = 'libcurl')" >> /usr/local/lib/R/etc/Rprofile.site && \
## Add a library directory (for user-installed packages)
mkdir -p /usr/local/lib/R/site-library && \
chown root:staff /usr/local/lib/R/site-library && \
chmod g+wx /usr/local/lib/R/site-library && \
## Fix library path
echo "R_LIBS_USER='/usr/local/lib/R/site-library'" >> /usr/local/lib/R/etc/Renviron && \
echo "R_LIBS=\${R_LIBS-'/usr/local/lib/R/site-library:/usr/local/lib/R/library:/usr/lib/R/library'}" >> /usr/local/lib/R/etc/Renviron && \
## install packages from date-locked MRAN snapshot of CRAN
[ -z "$BUILD_DATE" ] && BUILD_DATE=$(TZ="America/Los_Angeles" date -I) || true && \
MRAN=https://mran.microsoft.com/snapshot/${BUILD_DATE} && \
echo MRAN=$MRAN >> /etc/environment && \
export MRAN=$MRAN && \
echo "options(repos = c(CRAN='$MRAN'), download.file.method = 'libcurl')" >> /usr/local/lib/R/etc/Rprofile.site && \
## Use littler installation scripts
Rscript -e "install.packages(c('littler', 'docopt'), repo = '$MRAN')" && \
ln -s /usr/local/lib/R/site-library/littler/examples/install2.r /usr/local/bin/install2.r && \
ln -s /usr/local/lib/R/site-library/littler/examples/installGithub.r /usr/local/bin/installGithub.r && \
ln -s /usr/local/lib/R/site-library/littler/bin/r /usr/local/bin/r
## install r packages, bioconductor, etc ##
ADD install.r /tmp/
RUN R -f /tmp/install.r
# RUN R -e 'install.packages(c("devtools"))'
# RUN R -e 'devtools::install_github(repo = "satijalab/seurat", ref = "release/3.0")'
#RUN R -f "install.packages(c("devtools"))"
RUN Rscript -e "install.packages('devtools')"
# RUN Rscript -e "devtools::install_github(repo='satijalab/seurat', ref = 'release/${SEURAT_VERSION}')"
RUN Rscript -e "devtools::install_github('cole-trapnell-lab/leidenbase', dep=FALSE)"
RUN Rscript -e "devtools::install_github('cole-trapnell-lab/monocle3', dep=FALSE)"
RUN Rscript -e "devtools::install_github(repo='diazlab/CONICS/CONICSmat', dep = FALSE)"
# add umap
RUN pip3 install setuptools && \
pip3 install umap-learn
## Clean up
RUN cd / && \
rm -rf /tmp/* && \
apt-get autoremove -y && \
apt-get autoclean -y && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean