cache images
This commit is contained in:
parent
33ceea0579
commit
3d5a815004
1 changed files with 102 additions and 52 deletions
|
|
@ -1,6 +1,15 @@
|
|||
FROM alpine:3.20.3
|
||||
FROM alpine:3.20.3 AS jags
|
||||
|
||||
ARG R_VERSION=4.4.1
|
||||
RUN apk add -q --no-cache curl tar make lapack lapack-dev blas blas-dev gcc gfortran g++ git cmake tk-dev xz
|
||||
|
||||
# These usually are not packaged in OS repositories and need to be installed from source
|
||||
# - JAGS (needed for runjags which itself is again a dependency of many packages)
|
||||
RUN curl -s -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
|
||||
|
||||
FROM alpine:3.20.3 AS final
|
||||
|
||||
ARG R_VERSION=4.4.2
|
||||
ENV PATH=/opt/R/${R_VERSION}/bin:$PATH
|
||||
ENV TZ="Europe/Berlin"
|
||||
|
||||
|
|
@ -9,6 +18,8 @@ ENV NCPUS=2
|
|||
|
||||
ARG GITHUB_PAT
|
||||
|
||||
COPY --link --from=jags /JAGS-4.3.2 /JAGS-4.3.2
|
||||
|
||||
# Background: JAGS needs lapack & lapack-dev but these conflict with openblas-dev which is required by R-dev
|
||||
# Solution: first compile JAGS, then remove lapack & lapack-dev again
|
||||
# # xvfb: for graphical pkgs requiring tcl, like gWidgets2tcltk
|
||||
|
|
@ -37,11 +48,11 @@ RUN apk add -q --no-cache chromium
|
|||
RUN mkdir -p /root/.R && bash -c 'echo -e "CXX_STD = CXX14\nCXXFLAGS=-D__MUSL__\nCPPFLAGS=-D__MUSL__\nCFLAGS += -flax-vector-conversions\nLDFLAGS+=-fPIC\nCC=ccache gcc\nCPP=gcc -E\nCXXCPP=gcc -e\nCXX=ccache g++\nCXX11=ccache g++\nCXX14=ccache g++\nCXX17=ccache g++\nF77=gfortran\nFC=gfortran" > /root/.R/Makevars'
|
||||
|
||||
# R repos
|
||||
RUN bash -c 'echo -e "options(encoding = \"UTF-8\", 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 "options(crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL, repos = structure(c(CRAN = \"https://cran.devxy.io/$ARCH/alpine320/latest\", INLA = \"https://inla.r-inla-download.org/R/stable\")))" > /root/.Rprofile'
|
||||
RUN bash -c 'echo -e "PKG_SYSREQS=TRUE\nPKG_SYSREQS_VERBOSE=TRUE" > ~/.Renviron'
|
||||
|
||||
### INSTALL R
|
||||
RUN curl -O "https://devxy-r-builds.s3.eu-central-2.amazonaws.com/alpine320/r-${R_VERSION}_1_$(arch).apk"
|
||||
RUN curl -O "https://devxy-r-builds.s3.eu-central-003.backblazeb2.com/alpine320/r-${R_VERSION}_1_$(arch).apk"
|
||||
RUN apk add --allow-untrusted "r-${R_VERSION}_1_$(arch).apk" && rm "r-${R_VERSION}_1_$(arch).apk"
|
||||
|
||||
RUN R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/pak/devel/%s/%s/%s", .Platform$pkgType, R.Version()$os, R.Version()$arch))'
|
||||
|
|
@ -52,9 +63,6 @@ RUN R -q -e 'pak::pak(c("DBI", "R6", "RPostgres", "Rcpp", "askpass", "base64enc"
|
|||
# encoding -> https://github.com/r-hub/r-minimal/blob/fa9c117313e05860a0d20b113e5f794c51be8b8c/Dockerfile#L84
|
||||
RUN sed -i 's/,//g' /opt/R/${R_VERSION}/lib/R/library/utils/iconvlist
|
||||
|
||||
COPY --link . .
|
||||
# remove secrets from COPY
|
||||
RUN touch /.Renviron /.envrc && rm /.Renviron /.envrc
|
||||
RUN R -q -e 'pak::pak("git::https://gitlab.com/devxy/r-package-binaries/bincraftr.git")'
|
||||
|
||||
CMD ["/bin/bash"]
|
||||
Loading…
Reference in a new issue