-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
30 lines (18 loc) · 829 Bytes
/
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
FROM rocker/verse:4.2.1
# Install R packages with renv ----
# Create directory for renv project library
RUN mkdir /renv
# Modify Rprofile.site so renv uses /renv for project library
RUN echo 'Sys.setenv(RENV_PATHS_LIBRARY = "/renv")' >> /usr/local/lib/R/etc/Rprofile.site
# Initialize a 'dummy' project and restore the renv library.
# Since the library path is specified as above, the library will be restored to /renv
RUN mkdir /tmp/project
COPY ./renv.lock /tmp/project
WORKDIR /tmp/project
# Turn off cache
RUN Rscript -e 'install.packages("renv"); renv::consent(provided = TRUE); renv::settings$use.cache(FALSE); renv::init(bare = TRUE); renv::restore()'
# Install latex packages with tinytex ----
COPY install_latex.R .
RUN Rscript install_latex.R
# Add script to clone repo and run analysis
COPY make.sh /tmp/.