diff --git a/r-debug-1/Dockerfile b/r-debug-1/Dockerfile index cef6ab7..4ac333b 100644 --- a/r-debug-1/Dockerfile +++ b/r-debug-1/Dockerfile @@ -5,5 +5,5 @@ FROM wch1/r-devel # RDvalgrind: Install R-devel with valgrind level 2 instrumentation RUN /tmp/buildR.sh valgrind -RUN RDvalgrind -q -e 'install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev")' +RUN RDvalgrind -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))' RUN RDvalgrind -q -e 'pak::pkg_install(c("devtools", "Rcpp", "cpp11", "decor", "roxygen2", "testthat", "memoise", "rmarkdown"))' diff --git a/r-debug-2/Dockerfile b/r-debug-2/Dockerfile index 4200f5a..363524d 100644 --- a/r-debug-2/Dockerfile +++ b/r-debug-2/Dockerfile @@ -4,5 +4,5 @@ FROM wch1/r-debug-1 RUN /tmp/buildR.sh san -RUN RDsan -q -e 'install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev")' +RUN RDsan -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))' RUN RDsan -q -e 'pak::pkg_install(c("devtools", "Rcpp", "cpp11", "decor", "roxygen2", "testthat", "memoise", "rmarkdown"))' diff --git a/r-debug-3/Dockerfile b/r-debug-3/Dockerfile index 30e3293..91e538b 100644 --- a/r-debug-3/Dockerfile +++ b/r-debug-3/Dockerfile @@ -12,5 +12,5 @@ RUN sed -i 's/^#!\/bin\/bash/#!\/bin\/bash\nulimit -Ss 131072/' /usr/local/bin/R # Increase stack size in .bashrc, so that it is picked up by RDscriptcsan. RUN echo "\nulimit -Ss 131072" >> $HOME/.bashrc -RUN RDcsan -q -e 'install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev")' +RUN RDcsan -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))' RUN RDcsan -q -e 'pak::pkg_install(c("devtools", "Rcpp", "cpp11", "decor", "roxygen2", "testthat", "memoise", "rmarkdown"))' diff --git a/r-debug-4/Dockerfile b/r-debug-4/Dockerfile index ff9e0ce..b6fb017 100644 --- a/r-debug-4/Dockerfile +++ b/r-debug-4/Dockerfile @@ -5,5 +5,5 @@ FROM wch1/r-debug-3 # RDstrictbarrier: Make sure that R objects are protected properly. RUN /tmp/buildR.sh strictbarrier -RUN RDstrictbarrier -q -e 'install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev")' +RUN RDstrictbarrier -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))' RUN RDstrictbarrier -q -e 'pak::pkg_install(c("devtools", "Rcpp", "cpp11", "decor", "roxygen2", "testthat", "memoise", "rmarkdown"))' diff --git a/r-debug/Dockerfile b/r-debug/Dockerfile index 1dbde10..78f5750 100644 --- a/r-debug/Dockerfile +++ b/r-debug/Dockerfile @@ -6,5 +6,5 @@ FROM wch1/r-debug-4 # RDthreadcheck: Make sure that R's memory management functions are called # only from the main R thread. RUN /tmp/buildR.sh threadcheck -RUN RDthreadcheck -q -e 'install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev")' +RUN RDthreadcheck -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))' RUN RDthreadcheck -q -e 'pak::pkg_install(c("devtools", "Rcpp", "cpp11", "decor", "roxygen2", "testthat", "memoise", "rmarkdown"))' diff --git a/r-devel/Dockerfile b/r-devel/Dockerfile index 0210ae9..8cbf51d 100644 --- a/r-devel/Dockerfile +++ b/r-devel/Dockerfile @@ -17,6 +17,9 @@ MAINTAINER Winston Chang "winston@rstudio.com" # Don't print "debconf: unable to initialize frontend: Dialog" messages ARG DEBIAN_FRONTEND=noninteractive +# https://blog.thesparktree.com/docker-multi-arch-github-actions +ARG TARGETARCH + # Need this to add R repo RUN apt-get update && apt-get install -y software-properties-common wget dirmngr @@ -24,10 +27,6 @@ RUN apt-get update && apt-get install -y software-properties-common wget dirmngr RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - RUN add-apt-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main" -# Add R apt repository -RUN wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc -RUN add-apt-repository "deb http://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/" - # Install basic stuff, R, and other packages that are useful for compiling R # and R packages. RUN apt-get update && apt-get install -y \ @@ -37,9 +36,7 @@ RUN apt-get update && apt-get install -y \ vim \ less \ wget \ - r-base \ - r-base-dev \ - r-recommended \ + curl \ automake \ libtool \ fonts-texgyre \ @@ -53,6 +50,7 @@ RUN apt-get update && apt-get install -y \ libssl-dev \ libgit2-dev \ libxml2-dev \ + libreadline-dev \ texinfo \ rsync \ default-jdk \ @@ -81,26 +79,28 @@ RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-15 800 \ --slave /usr/bin/clang++ clang++ /usr/bin/clang++-15 \ --slave /usr/bin/llvm-symbolizer llvm-symbolizer /usr/bin/llvm-symbolizer-15 +# https://blog.thesparktree.com/docker-multi-arch-github-actions +RUN case ${TARGETARCH} in \ + "amd64") RIG_ARCH= ;; \ + "arm64") RIG_ARCH=-arm64 ;; \ + *) false ;; \ + esac \ + && curl -Ls https://github.com/r-lib/rig/releases/download/latest/rig-linux${RIG_ARCH}-latest.tar.gz | tar xz -C /usr/local \ + && rig add -RUN echo 'options(\n\ - repos = c(CRAN = "https://cloud.r-project.org/"),\n\ - download.file.method = "libcurl",\n\ - # Detect number of physical cores\n\ - Ncpus = parallel::detectCores(logical=FALSE)\n\ -)' >> /etc/R/Rprofile.site - +# Install some common packages specific to R-release +RUN R -q -e 'pak::pkg_install(c("devtools", "Rcpp", "cpp11", "decor", "roxygen2", "testthat", "memoise", "rmarkdown", "tinytex"))' # Install TinyTeX (subset of TeXLive) # From FAQ 5 and 6 here: https://yihui.name/tinytex/faq/ # Also install ae, parskip, and listings packages to build R vignettes RUN wget -qO- \ - "https://yihui.org/gh/tinytex/tools/install-unx.sh" | \ - sh -s - --admin --no-path \ + "https://yihui.org/gh/tinytex/tools/install-unx.sh" | sh -s - --admin --no-path \ && ~/.TinyTeX/bin/*/tlmgr path add \ && tlmgr install metafont mfware inconsolata tex ae parskip listings xcolor \ epstopdf-pkg pdftexcmds kvoptions texlive-scripts grfext \ && tlmgr path add \ - && Rscript -e "install.packages('tinytex'); tinytex::r_texmf()" + && Rscript -e "tinytex::r_texmf()" # ===================================================================== @@ -143,7 +143,7 @@ RUN /tmp/buildR.sh # Install some commonly-used packages to a location used by all the RD* # installations. These packages do not have compiled code and do not depend on # packages that have compiled code. -RUN RD -q -e 'install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/", "/usr/local/RD/lib/R/library")' +RUN RD -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), "/usr/local/RD/lib/R/library")' RUN RD -q -e 'pak::pkg_install(c("BH", "R6", "magrittr"), "/usr/local/RD/lib/R/library")' # Finally, install some common packages specific to this build of R.