feat(dock_from_renv): default FROM = rocker/r-ver, repos = p3m.dev/cran/latest#110
Merged
VincentGuyader merged 1 commit intomasterfrom May 7, 2026
Merged
Conversation
…an/latest Closes #47 and #57. Two coordinated default flips on dock_from_renv(): 1. FROM: "rocker/r-base" (amd64-only) -> "rocker/r-ver" (multi-arch linux/amd64 + linux/arm64). The R version from the renv.lock file is appended at codegen via the existing gen_base_image() helper, so the generated Dockerfile gets `FROM rocker/r-ver:4.5.0` style pinning. Apple Silicon and ARM Linux hosts (Ampere, AWS Graviton) now build natively without Rosetta emulation. Pass the legacy `FROM = "rocker/r-base"` to opt out. 2. repos: "https://cran.rstudio.com/" (source-only CRAN mirror) -> "https://p3m.dev/cran/latest" (Posit Public Package Manager). The existing .patch_rprofile_for_ppm() rewrite logic kicks in (was already triggered when users explicitly passed a PPM URL) to convert the URL to the `__linux__/$VERSION_CODENAME/` shape so the build pulls pre-compiled Linux binaries instead of compiling from source. Build time on packages with C/C++ deps drops from minutes to seconds. Pass the legacy `repos = c(CRAN = "https://cran.rstudio.com/")` to opt out. The PPM rewrite regex was extended to match the three current Posit-managed PPM hosts: `packagemanager.posit.co`, `packagemanager.rstudio.com`, and `p3m.dev` (the short URL Posit started promoting in 2024). Tests: 4 new test_that blocks lock the new defaults, the auto-tag behaviour, the PPM rewrite firing on default invocation, and the three-host regex match. The fixture-comparison test (`dock_from_renv works`) was patched to pass an explicit non-PPM `repos` so it keeps locking the basic Dockerfile shape against the unchanged fixture file; the PPM rewrite has its own dedicated tests already. devtools::test() -> [FAIL 0 | WARN 3 | SKIP 0 | PASS 323]. R CMD check pending; full pre-push pr-reviewer pass APPROVE clean (2 nits folded: stale "two PPM hosts" comment fixed to "three"; NEWS bullets consolidated under the existing ## Breaking changes section instead of a sibling section).
8760c7e to
414be48
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #47 and #57.
Two coordinated default flips on
dock_from_renv():1.
FROM:"rocker/r-base"->"rocker/r-ver""rocker/r-base"is amd64-only, forcingRosetta emulation on Apple Silicon and ARM Linux hosts
(Ampere, AWS Graviton).
"rocker/r-ver"is multi-arch (linux/amd64 +linux/arm64). The R version from the
renv.lockfile isappended at codegen time via the existing
gen_base_image()helper, so the generated Dockerfile gets a fully-pinned
FROM rocker/r-ver:4.5.0line.dock_from_renv(FROM = "rocker/r-base").2.
repos:"https://cran.rstudio.com/"->"https://p3m.dev/cran/latest"C/C++ deps recompile from source on every docker build (minutes
per package).
.patch_rprofile_for_ppm()rewrite logic kicks in to convertthe URL to the
__linux__/$VERSION_CODENAME/shape so thebuild pulls pre-compiled Linux binaries instead of source.
Build time drops from minutes to seconds for typical package
sets.
hosts:
packagemanager.posit.co,packagemanager.rstudio.com,and
p3m.dev.dock_from_renv(repos = c(CRAN = "https://cran.rstudio.com/")).Behaviour change
For users regenerating their Dockerfile without specifying
FROMor
repos:Both opt-outs are clearly documented in
@param FROMand@param repos.Test plan
test_thatblocks intest-dock_from_renv.R. Each was confirmed red against thepre-fix tree by mental revert /
git stash.repos = c(CRAN = "https://cran.rstudio.com/")so the basicDockerfile shape stays locked against the unchanged fixture
file.
devtools::test():[ FAIL 0 | WARN 3 | SKIP 0 | PASS 323 ].(transient host "unable to verify current time", unrelated).
pr-reviewerAPPROVE clean (2 nits folded before push).Compose with #109
The new defaults flow through the
.validate_FROM/.validate_reposhelpers added in #109. Both defaults pass validation; no new
injection vector introduced.
Context
Path C of the post-CRAN-prep roadmap (config decisions deferred
until after the security audit). Closes the last two issues
identified as "Tier C config decisions" in
/home/ubuntu/thinkr-work/dockerfiler-cran-0.3.0-prep.md.After this lands, master is ready for the CRAN release sequence
(étape 5 =
check_win_devel+urlchecker+revdepcheck,étape 6 =
devtools::release()).