cache images
This commit is contained in:
parent
33ceea0579
commit
3d5a815004
5 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"]
|
||||
|
|
@ -1,7 +1,19 @@
|
|||
FROM redhat/ubi8
|
||||
FROM redhat/ubi8 AS jags
|
||||
ARG RED_HAT_DEV_PW
|
||||
|
||||
RUN subscription-manager register --username mail@devxy.io --password "$RED_HAT_DEV_PW" && subscription-manager repos --enable codeready-builder-for-rhel-8-$(arch)-rpms
|
||||
RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && dnf install -y epel-release
|
||||
RUN dnf install -y -q gcc-c++ lapack-devel make git ca-certificates
|
||||
|
||||
# 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 redhat/ubi8 AS final
|
||||
|
||||
# renovate datasource=docker depName=rocker/r-ver
|
||||
ARG R_VERSION=4.4.1
|
||||
ARG R_VERSION=4.4.2
|
||||
ARG RED_HAT_DEV_PW
|
||||
ENV PATH=/opt/R/${R_VERSION}/bin:$PATH
|
||||
ENV TZ="Europe/Berlin"
|
||||
|
|
@ -11,6 +23,8 @@ ENV NCPUS=2
|
|||
|
||||
ARG GITHUB_PAT
|
||||
|
||||
COPY --link --from=jags /JAGS-4.3.2 /JAGS-4.3.2
|
||||
|
||||
RUN subscription-manager register --username mail@devxy.io --password "$RED_HAT_DEV_PW" && subscription-manager repos --enable codeready-builder-for-rhel-8-$(arch)-rpms
|
||||
RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm && dnf install -y epel-release
|
||||
# xvfb: for graphical pkgs requiring tcl, like gWidgets2tcltk
|
||||
|
|
@ -22,12 +36,12 @@ RUN dnf install -y -q make lapack-devel git gcc gcc-c++ fontconfig-devel fribidi
|
|||
### CUSTOM DEPENDENCIES
|
||||
# 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 -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 && make install 2>&1 >/dev/null && rm -rf JAGS-4.3.2.tar.gz JAGS-4.3.2 && cd ..
|
||||
RUN cd /JAGS-4.3.2 && make 2>&1 && make install 2>&1 >/dev/null && rm -rf JAGS-4.3.2 && cd ..
|
||||
# - Chromium should be auto-installed once pkgdepends merges the latest system-requirements rule changes
|
||||
RUN dnf install -y chromium
|
||||
|
||||
### INSTALL R
|
||||
RUN curl -O "https://devxy-r-builds.s3.eu-central-2.amazonaws.com/el8/R-${R_VERSION}-1-1.$(arch).rpm"
|
||||
RUN curl -O "https://devxy-r-builds.s3.eu-central-003.backblazeb2.com/el8/R-${R_VERSION}-1-1.$(arch).rpm"
|
||||
RUN dnf install -q -y "R-${R_VERSION}-1-1.$(arch).rpm" && rm "R-${R_VERSION}-1-1.$(arch).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))'
|
||||
|
||||
|
|
@ -37,16 +51,13 @@ RUN R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/
|
|||
RUN mkdir -p /root/.R && bash -c 'echo -e "CXX_STD = CXX14\nCFLAGS += -flax-vector-conversions\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://cran.devxy.io/$ARCH/rhel8/latest\", 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/rhel8/latest\", INLA = \"https://inla.r-inla-download.org/R/stable\")))" > /root/.Rprofile'
|
||||
RUN bash -c 'echo -e "PKG_SYSREQS = TRUE\nPKG_SYSREQS_VERBOSE = TRUE\nPKG_SYSREQS_PLATFORM=\"redhat-8\"" > /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 'Sys.setenv("PKG_SYSREQS_PLATFORM" = "redhat-8"); pak::pak(c("DBI", "R6", "RPostgres", "Rcpp", "askpass", "base64enc", "bit64", "bit", "blob", "callr", "cli", "credentials", "curl", "data.table", "desc", "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", "cranlike", "RSQLite", "cachem", "crayon", "debugme", "fastmap", "memoise", "progress", "future.callr", "dbplyr"))'
|
||||
RUN R -q -e 'pak::pak(c("DBI", "R6", "RPostgres", "Rcpp", "askpass", "base64enc", "bit64", "bit", "blob", "callr", "cli", "credentials", "curl", "data.table", "desc", "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", "cranlike", "RSQLite", "cachem", "crayon", "debugme", "fastmap", "memoise", "progress", "future.callr", "dbplyr"))'
|
||||
|
||||
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"]
|
||||
|
|
@ -1,6 +1,19 @@
|
|||
FROM redhat/ubi9
|
||||
FROM redhat/ubi9 AS jags
|
||||
ARG RED_HAT_DEV_PW
|
||||
|
||||
ARG R_VERSION=4.4.1
|
||||
RUN subscription-manager register --username mail@devxy.io --password "$RED_HAT_DEV_PW" && subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms
|
||||
RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && dnf install -y epel-release
|
||||
RUN dnf install -y -q gcc-c++ lapack-devel make git ca-certificates
|
||||
|
||||
# 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 redhat/ubi9 AS final
|
||||
|
||||
# renovate datasource=docker depName=rocker/r-ver
|
||||
ARG R_VERSION=4.4.2
|
||||
ARG RED_HAT_DEV_PW
|
||||
ENV PATH=/opt/R/${R_VERSION}/bin:$PATH
|
||||
ENV TZ="Europe/Berlin"
|
||||
|
|
@ -10,23 +23,25 @@ ENV NCPUS=2
|
|||
|
||||
ARG GITHUB_PAT
|
||||
|
||||
COPY --link --from=jags /JAGS-4.3.2 /JAGS-4.3.2
|
||||
|
||||
RUN subscription-manager register --username mail@devxy.io --password "$RED_HAT_DEV_PW" && subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms
|
||||
RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && dnf install -y epel-release
|
||||
# xvfb: for graphical pkgs requiring tcl, like gWidgets2tcltk
|
||||
# ImageMagick-c++-devel ImageMagick-devel: boths are not auto-installed via pak sysreqs
|
||||
# mecab-devel: RcppMeCab -> no autodetection yet
|
||||
# libfftw3-dev: ravetools -> actually auto-detect but somehow doesn't work in container?
|
||||
RUN dnf install -y -q make lapack-devel git gcc gcc-c++ fontconfig-devel fribidi-devel libjpeg-turbo-devel libtiff-devel postgresql-devel htop libgit2-devel libxml2-devel hiredis ccache cmake xorg-x11-server-Xvfb tk-devel ImageMagick-c++-devel ImageMagick-devel xz pkg-config mecab-devel fftw-devel automake
|
||||
RUN dnf install -y -q make lapack-devel git gcc gcc-c++ fontconfig-devel fribidi-devel libjpeg-turbo-devel libtiff-devel postgresql-devel htop libgit2-devel libxml2-devel hiredis ccache cmake xorg-x11-server-Xvfb ImageMagick-c++-devel ImageMagick-devel xz pkg-config mecab-devel fftw-devel tk-devel automake
|
||||
|
||||
### CUSTOM DEPENDENCIES
|
||||
# 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 -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 && make install 2>&1 >/dev/null && rm -rf JAGS-4.3.2.tar.gz JAGS-4.3.2 && cd ..
|
||||
RUN cd /JAGS-4.3.2 && make 2>&1 && make install 2>&1 >/dev/null && rm -rf JAGS-4.3.2 && cd ..
|
||||
# - Chromium should be auto-installed once pkgdepends merges the latest system-requirements rule changes
|
||||
RUN dnf install -y chromium
|
||||
|
||||
### INSTALL R
|
||||
RUN curl -O "https://devxy-r-builds.s3.eu-central-2.amazonaws.com/el9/R-${R_VERSION}-1-1.$(arch).rpm"
|
||||
RUN curl -O "https://devxy-r-builds.s3.eu-central-003.backblazeb2.com/el8/R-${R_VERSION}-1-1.$(arch).rpm"
|
||||
RUN dnf install -q -y "R-${R_VERSION}-1-1.$(arch).rpm" && rm "R-${R_VERSION}-1-1.$(arch).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))'
|
||||
|
||||
|
|
@ -36,14 +51,13 @@ RUN R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/
|
|||
RUN mkdir -p /root/.R && bash -c 'echo -e "CXX_STD = CXX14\nCFLAGS += -flax-vector-conversions\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://cran.devxy.io/$ARCH/rhel9/latest\", 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/rhel9/latest\", INLA = \"https://inla.r-inla-download.org/R/stable\")))" > /root/.Rprofile'
|
||||
RUN bash -c 'echo -e "PKG_SYSREQS = TRUE\nPKG_SYSREQS_VERBOSE = TRUE\nPKG_SYSREQS_PLATFORM=\"redhat-9\"" > /root/.Renviron'
|
||||
|
||||
RUN R -q -e 'Sys.setenv("PKG_SYSREQS_PLATFORM" = "redhat-9"); pak::pak(c("DBI", "R6", "RPostgres", "Rcpp", "askpass", "base64enc", "bit64", "bit", "blob", "callr", "cli", "credentials", "curl", "data.table", "desc", "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", "cranlike", "RSQLite", "cachem", "crayon", "debugme", "fastmap", "memoise", "progress", "future.callr", "dbplyr"))'
|
||||
# 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", "desc", "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", "cranlike", "RSQLite", "cachem", "crayon", "debugme", "fastmap", "memoise", "progress", "future.callr", "dbplyr"))'
|
||||
|
||||
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"]
|
||||
|
|
@ -14,6 +14,8 @@ ENV DEBIAN_FRONTEND=noninteractive
|
|||
|
||||
ENV ARCH=arm64
|
||||
ENV NCPUS=2
|
||||
ENV R_LIBS_USER=/mnt/cache/R-pkgs
|
||||
ENV R_PKG_CACHE_DIR=/mnt/cache/pkgcache
|
||||
|
||||
ARG GITHUB_PAT
|
||||
|
||||
|
|
@ -35,7 +37,7 @@ RUN apt-get install -y software-properties-common && \
|
|||
apt install -y chromium
|
||||
|
||||
### INSTALL R
|
||||
RUN curl -O "https://devxy-r-builds.s3.eu-central-2.amazonaws.com/2204/r-${R_VERSION}_1_$(dpkg --print-architecture).deb"
|
||||
RUN curl -O "https://devxy-r-builds.s3.eu-central-003.backblazeb2.com/2204/r-${R_VERSION}_1_$(dpkg --print-architecture).deb"
|
||||
RUN gdebi -n -qq "r-${R_VERSION}_1_$(dpkg --print-architecture).deb" && rm "r-${R_VERSION}_1_$(dpkg --print-architecture).deb"
|
||||
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))'
|
||||
|
||||
|
|
@ -45,14 +47,17 @@ RUN R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/
|
|||
RUN mkdir -p /root/.R && bash -c 'echo -e "CXX_STD = CXX14\nCFLAGS += -flax-vector-conversions\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\", pkg.sysreqs_verbose = TRUE, crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL, repos = structure(c(CRAN = \"https://cran.devxy.io/$ARCH/jammy/latest\", INLA = \"https://inla.r-inla-download.org/R/stable\")))" > ~/.Rprofile'
|
||||
RUN bash -c 'echo -e "options(pkg.sysreqs_verbose = TRUE, crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL, repos = structure(c(CRAN = \"https://cran.devxy.io/amd64/jammy/latest\", INLA = \"https://inla.r-inla-download.org/R/stable\")))" > ~/.Rprofile'
|
||||
|
||||
# these dirs will later be used by the CI with existing mounts
|
||||
RUN mkdir -p /mnt/cache/packages /mnt/cache/pkgcache /mnt/cache/R-pkgs
|
||||
|
||||
RUN R -q -e 'dir.create(Sys.getenv("R_LIBS_USER"), recursive = TRUE)'
|
||||
RUN R -q -e "pak::pak(c('DBI', 'R6', 'RPostgres', 'Rcpp', 'askpass', 'base64enc', 'bit64', 'bit', 'blob', 'callr', 'cli', 'credentials', 'curl', 'data.table', 'desc', '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', 'cranlike', 'RSQLite', 'cachem', 'crayon', 'debugme', 'fastmap', 'memoise', 'progress', 'future.callr', 'dbplyr'))"
|
||||
|
||||
# COPY --link . .
|
||||
# remove secrets from COPY
|
||||
# RUN touch /.Renviron /.envrc && rm /.Renviron /.envrc
|
||||
RUN apt install -y locales && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \
|
||||
&& locale-gen en_US.utf8 \
|
||||
&& /usr/sbin/update-locale LANG=en_US.UTF-8
|
||||
|
||||
RUN R -q -e 'pak::pak("git::https://gitlab.com/devxy/r-package-binaries/bincraftr.git")'
|
||||
|
||||
CMD ["/bin/bash"]
|
||||
|
|
@ -1,15 +1,26 @@
|
|||
FROM ubuntu:noble
|
||||
FROM ubuntu:noble as jags
|
||||
|
||||
ARG R_VERSION=4.4.1
|
||||
RUN apt update && apt install -y --no-install-recommends curl make ca-certificates gcc g++ gfortran liblapack-dev
|
||||
# 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 -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
|
||||
|
||||
FROM ubuntu:noble as final
|
||||
|
||||
ARG R_VERSION=4.4.2
|
||||
ENV PATH=/opt/R/${R_VERSION}/bin:$PATH
|
||||
ENV TZ="Europe/Berlin"
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
ENV ARCH=arm64
|
||||
ENV NCPUS=2
|
||||
ENV R_LIBS_USER=/mnt/cache/R-pkgs
|
||||
ENV R_PKG_CACHE_DIR=/mnt/cache/pkgcache
|
||||
|
||||
ARG GITHUB_PAT
|
||||
|
||||
COPY --link --from=jags /JAGS-4.3.2 /JAGS-4.3.2
|
||||
|
||||
# xvfb: for graphical pkgs requiring tcl, like gWidgets2tcltk
|
||||
# tcl tk tk-dev tk-table: must be available before running xvfb-run (i.e. starting the graphical session)
|
||||
# libmecab-dev: RcppMeCab -> no autodetection yet
|
||||
|
|
@ -17,9 +28,8 @@ ARG GITHUB_PAT
|
|||
RUN apt update && apt install -y --no-install-recommends gdebi-core g++ gfortran libbz2-dev libblas-dev libicu-dev liblapack-dev liblzma-dev libpaper-utils libpcre2-dev libtcl8.6 libtk8.6 libxt6 unzip zip zlib1g-dev libpcre3-dev libopenblas-dev curl ca-certificates make ccache htop libgit2-dev git libpq-dev libxml2-dev libgit2-dev cmake xvfb libcurl4-openssl-dev xz-utils tcl tk tk-dev tk-table pkg-config libmecab-dev libfftw3-dev automake
|
||||
|
||||
### CUSTOM DEPENDENCIES
|
||||
# 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 -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 && make install 2>&1 >/dev/null && rm -rf JAGS-4.3.2.tar.gz JAGS-4.3.2 && cd ..
|
||||
# JAGS
|
||||
RUN cd /JAGS-4.3.2 && make 2>&1 && make install 2>&1 >/dev/null && rm -rf JAGS-4.3.2 && cd ..
|
||||
# - Chromium should be auto-installed once pkgdepends merges the latest system-requirements rule changes
|
||||
RUN apt-get install -y software-properties-common && \
|
||||
add-apt-repository -y ppa:xtradeb/apps && \
|
||||
|
|
@ -27,7 +37,7 @@ RUN apt-get install -y software-properties-common && \
|
|||
apt install -y chromium
|
||||
|
||||
### INSTALL R
|
||||
RUN curl -O "https://devxy-r-builds.s3.eu-central-2.amazonaws.com/2404/r-${R_VERSION}_1_$(dpkg --print-architecture).deb"
|
||||
RUN curl -O "https://devxy-r-builds.s3.eu-central-003.backblazeb2.com/2404/r-${R_VERSION}_1_$(dpkg --print-architecture).deb"
|
||||
RUN gdebi -n -qq "r-${R_VERSION}_1_$(dpkg --print-architecture).deb" && rm "r-${R_VERSION}_1_$(dpkg --print-architecture).deb"
|
||||
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))'
|
||||
|
||||
|
|
@ -37,13 +47,17 @@ RUN R -q -e 'install.packages("pak", repos = sprintf("https://r-lib.github.io/p/
|
|||
RUN mkdir -p /root/.R && bash -c 'echo -e "CXX_STD = CXX14\nCFLAGS += -flax-vector-conversions\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\", pkg.sysreqs_verbose = TRUE, crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL, repos = structure(c(CRAN = \"https://cran.devxy.io/$ARCH/noble/latest\", INLA = \"https://inla.r-inla-download.org/R/stable\")))" > ~/.Rprofile'
|
||||
RUN bash -c 'echo -e "options(pkg.sysreqs_verbose = TRUE, crayon.enabled = TRUE, Ncpus = ${NCPUS}, future.globals.onReference = NULL, repos = structure(c(CRAN = \"https://cran.devxy.io/amd64/noble/latest\", INLA = \"https://inla.r-inla-download.org/R/stable\")))" > ~/.Rprofile'
|
||||
|
||||
RUN R -q -e 'pak::pak(c("DBI", "R6", "RPostgres", "Rcpp", "askpass", "base64enc", "bit64", "bit", "blob", "callr", "cli", "credentials", "curl", "data.table", "desc", "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", "cranlike", "RSQLite", "cachem", "crayon", "debugme", "fastmap", "memoise", "progress", "future.callr", "dbplyr"))'
|
||||
# these dirs will later be used by the CI with existing mounts
|
||||
RUN mkdir -p /mnt/cache/packages /mnt/cache/pkgcache /mnt/cache/R-pkgs
|
||||
|
||||
RUN R -q -e "pak::pak(c('DBI', 'R6', 'RPostgres', 'Rcpp', 'askpass', 'base64enc', 'bit64', 'bit', 'blob', 'callr', 'cli', 'credentials', 'curl', 'data.table', 'desc', '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', 'cranlike', 'RSQLite', 'cachem', 'crayon', 'debugme', 'fastmap', 'memoise', 'progress', 'future.callr', 'dbplyr'))"
|
||||
|
||||
RUN apt install -y locales && echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen \
|
||||
&& locale-gen en_US.utf8 \
|
||||
&& /usr/sbin/update-locale LANG=en_US.UTF-8
|
||||
|
||||
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