-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
129 lines (109 loc) · 3.64 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
FROM rocker/r-ver:4.3.2
## Install the os packages
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libgdal-dev \
libproj-dev \
libgeos-dev \
lbzip2 \
libssl-dev \
libudunits2-dev \
imagemagick \
pandoc \
pandoc-citeproc \
make \
ghostscript \
poppler-utils \
zip \
wget \
fonts-dejavu-extra \
libfontconfig1-dev \
libharfbuzz-dev \
libfribidi-dev \
curl \
tk \
libglpk-dev \
&& rm -rf /var/lib/apt/lists/*
RUN R -e "options(repos = \
list(CRAN = 'https://packagemanager.posit.co/cran/2024-02-20/')); \
install.packages('dplyr'); \
install.packages('lubridate'); \
install.packages('ggplot2'); \
install.packages('readr'); \
install.packages('stringr'); \
install.packages('tidyr'); \
install.packages('tidyverse'); \
"
## Install extra packages required for quarto
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
gdebi-core \
&& rm -rf /var/lib/apt/lists/*
ARG QUARTO_VERSION="1.4.550"
RUN curl -o quarto-linux-amd64.deb -L https://github.com/quarto-dev/quarto-cli/releases/download/v${QUARTO_VERSION}/quarto-${QUARTO_VERSION}-linux-amd64.deb
RUN gdebi --non-interactive quarto-linux-amd64.deb
RUN R -e "options(repos = \
list(CRAN = 'https://packagemanager.posit.co/cran/2024-02-20/')); \
install.packages('quarto'); \
"
RUN R -e "options(repos = \
list(CRAN = 'https://packagemanager.posit.co/cran/2024-02-20/')); \
install.packages('remotes'); \
"
RUN R -e "options(repos = \
list(CRAN = 'https://packagemanager.posit.co/cran/2024-02-20/')); \
install.packages('rstan'); \
install.packages('brms'); \
install.packages('tidybayes'); \
install.packages('cmdstanr', repos = c('https://mc-stan.org/r-packages/', getOption('repos'))); \
remotes::install_github('stan-dev/cmdstanr'); \
library(cmdstanr); \
check_cmdstan_toolchain(); \
install_cmdstan(cores = 2); \
"
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
cmake \
&& rm -rf /var/lib/apt/lists/*
## Other packages that are dependencies of INLA
RUN R -e "options(repos = \
list(CRAN = 'https://packagemanager.posit.co/cran/2024-02-20/')); \
install.packages('sp'); \
install.packages('fmesher'); \
"
## Install INLA
RUN wget https://inla.r-inla-download.org/R/stable/src/contrib/INLA_24.02.09.tar.gz \
&& R CMD INSTALL --clean --no-multiarch --without-keep.source --byte-compile --resave-data --compact-docs --no-demo INLA_24.02.09.tar.gz \
&& rm INLA_24.02.09.tar.gz
RUN R -e "options(repos = \
list(CRAN = 'https://packagemanager.posit.co/cran/2024-02-20/')); \
install.packages('furrr'); \
install.packages('progressr'); \
"
RUN R -e "options(repos = \
list(CRAN = 'https://packagemanager.posit.co/cran/2024-02-20/')); \
install.packages('glmmTMB'); \
install.packages('emmeans'); \
install.packages('DHARMa'); \
install.packages('patchwork'); \
"
RUN R -e "options(repos = \
list(CRAN = 'https://packagemanager.posit.co/cran/2024-02-20/')); \
install.packages('posterior'); \
install.packages('bayesplot'); \
install.packages('DT'); \
install.packages('easystats'); \
install.packages('modelsummary'); \
remotes::install_github('inbo/inlatools'); \
remotes::install_github('jmgirard/standist'); \
remotes::install_github('timcdlucas/INLAutils'); \
install.packages('styler'); \
"
## Create project directory in docker image
RUN mkdir ~/Project
## Copy scripts and parameters (folders and contents) into docker image project directory
COPY R/ ~/Project/R/
## COPY docs/ ~/Project/docs/
WORKDIR ~/Project/
## ENTRYPOINT ["make", "-i","all"]