-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
70 lines (58 loc) · 2.32 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
# This runs an R script belonging to a local library and saves its plotly graphs as image files
FROM rocker/r-ver:4.0.3
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
apt-utils \
ed \
libnlopt-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/
RUN apt-get update && apt-get install -y --no-install-recommends \
software-properties-common \
dirmngr \
git-core \
libcurl4-openssl-dev \
libgit2-dev \
libssh2-1-dev \
libicu-dev \
libpng-dev \
libudunits2-dev \
zlib1g-dev \
libgdal-dev \
libproj-dev \
xml2 \
openssl \
python3
# `python` needed for `save_image()`
RUN add-apt-repository --enable-source --yes "ppa:marutter/rrutter4.0"
RUN add-apt-repository --enable-source --yes "ppa:c2d4u.team/c2d4u4.0+"
RUN apt install -y r-cran-rcpparmadillo
RUN mkdir /epiline/
COPY R/ /epiline/R/
COPY src/ /epiline/src/
COPY examples/ /epiline/examples/
COPY DESCRIPTION /epiline/
COPY NAMESPACE /epiline/
COPY tools/ /epiline/tools/
COPY examples/ /epiline/examples/
WORKDIR /epiline
# required by local library
# not using urls to .tar.gz files due to `{packages} are not available for package ‘EpiLine’`
RUN Rscript -e "install.packages('http://cran.r-project.org/src/contrib/Archive/Rcpp/Rcpp_1.0.8.2.tar.gz', repos=NULL, type='source')"
RUN Rscript -e "install.packages('rstan', repos='http://cran.rstudio.com/')"
RUN Rscript -e "install.packages('rstantools', repos='http://cran.rstudio.com/')"
RUN Rscript -e "install.packages('data.table', repos='http://cran.rstudio.com/')"
RUN Rscript -e "install.packages('plotly', repos='http://cran.rstudio.com/')"
RUN Rscript -e "install.packages('moments', repos='http://cran.rstudio.com/')"
# needed for `save_image()`
RUN Rscript -e "install.packages('reticulate', repos='http://cran.rstudio.com/')"
# needed to use local library
RUN Rscript -e "install.packages('devtools', repos='http://cran.rstudio.com/')"
RUN Rscript -e "devtools::load_all()"
RUN Rscript -e "devtools::install()"
# needed for `save_image()`
RUN Rscript -e "reticulate::install_miniconda()"
RUN Rscript -e "reticulate::conda_install('r-reticulate', 'python-kaleido')"
RUN Rscript -e "reticulate::conda_install('r-reticulate', 'plotly', channel = 'plotly')"
RUN Rscript -e "reticulate::use_miniconda('r-reticulate')"
CMD Rscript /epiline/examples/linear_r_dist.R