This commit is contained in:
Patrick Schratz 2024-09-10 17:38:14 +02:00
commit f64db635a0
Signed by: pat-s
GPG key ID: 3C6318841EF78925

View file

@ -25,8 +25,8 @@ RUN dnf install -y -q make lapack-devel git gcc gcc-c++ fontconfig-devel fribidi
RUN curl -q -L -O https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Source/JAGS-4.3.2.tar.gz && tar -xzf JAGS-4.3.2.tar.gz && cd JAGS-4.3.2 && ./configure --enable-silent-rules && make 2>&1 >/dev/null && rm -rf JAGS-4.3.2.tar.gz JAGS-4.3.2 && cd ..
### INSTALL R
RUN curl -O https://devxy-r-builds.s3.eu-central-2.amazonaws.com/el9/R-${R_VERSION}-1-1.aarch64.rpm
RUN dnf install -q -y R-${R_VERSION}-1-1.aarch64.rpm
RUN curl -O "https://devxy-r-builds.s3.eu-central-2.amazonaws.com/el9/R-${R_VERSION}-1-1.aarch64.rpm"
RUN dnf install -q -y "R-${R_VERSION}-1-1.aarch64.rpm" && rm "R-${R_VERSION}-1-1.aarch64.rpm"
RUN R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/stable/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))'
# Makevars
@ -34,15 +34,12 @@ RUN mkdir -p /root/.R && bash -c 'echo -e "CXX_STD = CXX14\nCC=ccache gcc\nCPP=c
# R repos
RUN bash -c 'echo -e "options(crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL, repos = structure(c(CRAN = \"https://cloud.r-project.org\", INLA = \"https://inla.r-inla-download.org/R/stable\")))" > /root/.Rprofile'
RUN bash -c 'echo -e "PKG_SYSREQS = TRUE\nPKG_SYSREQS_VERBOSE = TRUE" > /root/.Renviron'
# FIXME: switch to pak after https://github.com/r-lib/pak/issues/628
# deps from pak::pkg_deps(".")$package
RUN R -q -e 'pak::pak(c("DBI", "R6", "RPostgres", "Rcpp", "askpass", "base64enc", "bit64", "bit", "blob", "callr", "cli", "credentials", "curl", "data.table", "digest", "dplyr", "fansi", "fs", "future.apply", "future", "generics", "gert", "globals", "glue", "hms", "httr", "jsonlite", "lgr", "lifecycle", "listenv", "lubridate", "magrittr", "mime", "openssl", "parallelly", "paws.common", "paws.storage", "pillar", "pkgbuild", "pkgconfig", "processx", "progressr", "ps", "purrr", "rlang", "rstudioapi","s3fs", "stringi", "stringr", "sys", "tibble", "tidyselect", "timechange", "utf8", "vctrs", "withr", "xml2", "zip", "codetools", "RSQLite", "cachem", "crayon", "debugme", "fastmap", "memoise", "pat-s/cranlike@s3", "pat-s/desc@description-from-remote"))'
COPY . .
RUN R -q -e 'pak::local_install_deps()'
# remove secrets from COPY
RUN rm /.Renviron /.envrc
RUN touch /.Renviron /.envrc && rm /.Renviron /.envrc
RUN R CMD INSTALL . && rm -rf r-pkg-binaries
CMD ["/bin/bash"]