11# 1. Use R 4.5.1
22FROM rocker/r-ver:4.5.1
33
4- # 2. Install system dependencies (restoring cmake and adding nlopt )
4+ # 2. Install system dependencies (including cmake, nlopt, curl, and certificates )
55RUN apt-get update && apt-get install -y --no-install-recommends \
66 libxml2-dev libssl-dev libcurl4-openssl-dev libpng-dev \
77 libjpeg-dev libtiff-dev libfreetype6-dev libharfbuzz-dev \
@@ -13,24 +13,27 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1313# 3. Setup Environment
1414ENV R_LIBS_USER=/opt/renv/library
1515ENV RENV_PATHS_LIBRARY=/opt/renv/library
16- ENV R_PROFILE_USER=/dev/null
17- # Force renv to use the Linux binaries for speed
16+ ENV R_PROFILE_USER=/dev/null
17+ # Force renv to use Linux binaries for speed
1818ENV RENV_CONFIG_REPOS_OVERRIDE="https://packagemanager.posit.co/cran/__linux__/noble/latest"
19+ # Force renv to install binaries where available
20+ ENV RENV_CONFIG_INSTALL_TYPE=binary
1921
2022WORKDIR /project
2123
2224# 4. Restore Packages (Cached Layer)
2325COPY renv.lock .Rprofile ./
2426COPY renv/activate.R renv/activate.R
2527
26- # Bootstrap: Install renv from binaries
28+ # Bootstrap: Install renv from CRAN binaries
2729RUN R -e "options(repos = c(CRAN = 'https://packagemanager.posit.co/cran/__linux__/noble/latest')); install.packages('renv')"
2830
2931RUN mkdir -p /opt/renv/library
30- # Now renv::restore will work with the binary override
31- RUN R -e "renv::restore(library='/opt/renv/library', type='binary')"
3232
33- # 5. Copy ALL Application Files
33+ # Restore packages to /opt/renv/library (binaries used via env variable)
34+ RUN R -e "renv::restore(library='/opt/renv/library')"
35+
36+ # 5. Copy all application files
3437COPY . .
3538
3639# 6. Execution Logic
0 commit comments