1- # 1. Use r-ver (Works on Mac ARM64 and GitHub AMD64)
2- FROM rocker/r-ver:latest
1+ # 1. Use the Jammy-based image to match Posit's Ubuntu 22.04 binaries
2+ FROM rocker/r-ver:4.4.2-jammy
33
44# 2. Install system dependencies + Pandoc
5- # Added image libraries (libpng, libjpeg) and string processing (libicu)
65RUN apt-get update && apt-get install -y --no-install-recommends \
76 libxml2-dev \
87 libssl-dev \
@@ -17,23 +16,23 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1716WORKDIR /project
1817
1918# 3. FORCE BINARIES & PARALLELISM
19+ # These binaries now match the OS (Jammy) perfectly, preventing 'stringi' errors
2020ENV RENV_CONFIG_REPOS_OVERRIDE="https://packagemanager.posit.co/cran/__linux__/jammy/latest"
2121ENV RENV_DOWNLOAD_METHOD="libcurl"
2222ENV RENV_PATHS_LIBRARY="renv/library"
2323
2424# 4. Setup renv files
2525COPY renv.lock .Rprofile ./
2626COPY renv/activate.R renv/activate.R
27- # Pre-create the library folder
2827RUN mkdir -p renv/library data
2928
3029# 5. Restore using all available CPU cores
31- # This will now find the 'png.h' header it needs for the 'png' package
3230RUN R -e "options(Ncpus = parallel::detectCores()); renv::restore()"
3331
34- # 6. Copy project assets
32+ # 6. Copy project assets (Ensure configuration.yml is NOT copied if you want to mount it at runtime)
3533COPY *.Rmd ./
3634COPY _site.ym[l] ./
35+ # Optional: COPY configuration.yml configuration.yml (only if you want a baked-in default)
3736
3837# 7. Render
3938CMD ["R" , "-e" , "rmarkdown::render_site()" ]
0 commit comments