-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
54 lines (44 loc) · 1.76 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
# using rocker r-vers as a base with R 4.4.0
# https://hub.docker.com/r/rocker/r-ver
# https://rocker-project.org/images/versioned/r-ver.html
ARG R_VERS="4.4.0"
FROM rocker/r-ver:$R_VERS AS base
# set Docker image labels
LABEL org.opencontainers.image.source=https://github.com/RMI-PACTA/workflow.benchmark.preparation
LABEL org.opencontainers.image.description="Docker image to run benchmark preparation"
LABEL org.opencontainers.image.licenses=MIT
LABEL org.opencontainers.image.title=""
LABEL org.opencontainers.image.revision=""
LABEL org.opencontainers.image.version=""
LABEL org.opencontainers.image.vendor=""
LABEL org.opencontainers.image.base.name=""
LABEL org.opencontainers.image.ref.name=""
LABEL org.opencontainers.image.authors=""
WORKDIR /app
# set apt-get to noninteractive mode
ARG DEBIAN_FRONTEND="noninteractive"
ARG DEBCONF_NOWARNINGS="yes"
# install system dependencies
RUN apt-get update \
&& rm -rf /var/lib/apt/lists/*
# sets CRAN repo to use Posit Package Manager to freeze R package versions to
# those available on 2024-05-15
# https://packagemanager.posit.co/client/#/repos/2/overview
# https://packagemanager.posit.co/cran/__linux__/jammy/2024-05-15
ARG CRAN_REPO="https://packagemanager.posit.co/cran/__linux__/jammy/2024-05-15"
RUN echo "options(repos = c(CRAN = '$CRAN_REPO'), pkg.sysreqs = FALSE)" >> "${R_HOME}/etc/Rprofile.site" \
&& Rscript -e "\
install.packages('pak'); \
"
# copy in DESCRIPTION from this repo
COPY DESCRIPTION /app/DESCRIPTION
# install pak, find dependencies from DESCRIPTION, and install them
RUN Rscript -e "\
deps <- pak::local_deps(root = '.'); \
pkg_deps <- deps[!deps[['direct']], 'ref']; \
print(pkg_deps); \
pak::pak(pkg_deps); \
"
COPY config.yml /app/config.yml
COPY *.R /app/
CMD ["Rscript", "/app/main.R"]