Skip to content

Commit 33d1901

Browse files
committed
added env variable and removed type=binary
1 parent eb6aac9 commit 33d1901

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

Dockerfile

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# 1. Use R 4.5.1
22
FROM 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)
55
RUN 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
1414
ENV R_LIBS_USER=/opt/renv/library
1515
ENV 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
1818
ENV 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

2022
WORKDIR /project
2123

2224
# 4. Restore Packages (Cached Layer)
2325
COPY renv.lock .Rprofile ./
2426
COPY renv/activate.R renv/activate.R
2527

26-
# Bootstrap: Install renv from binaries
28+
# Bootstrap: Install renv from CRAN binaries
2729
RUN R -e "options(repos = c(CRAN = 'https://packagemanager.posit.co/cran/__linux__/noble/latest')); install.packages('renv')"
2830

2931
RUN 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
3437
COPY . .
3538

3639
# 6. Execution Logic

0 commit comments

Comments
 (0)