Skip to content

Commit 71eb0df

Browse files
committed
add cmake
1 parent 687ba32 commit 71eb0df

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
11
# 1. Use R 4.5.1
22
FROM rocker/r-ver:4.5.1
33

4-
# 2. Install system dependencies
4+
# 2. Install system dependencies (restoring cmake and adding nlopt)
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 \
88
libfribidi-dev libicu-dev libglpk-dev zlib1g-dev \
99
gfortran pandoc pkg-config \
10+
cmake libnlopt-dev \
1011
&& rm -rf /var/lib/apt/lists/*
1112

1213
# 3. Setup Environment
1314
ENV R_LIBS_USER=/opt/renv/library
1415
ENV RENV_PATHS_LIBRARY=/opt/renv/library
15-
# This prevents your local .Rprofile from causing loops during build
1616
ENV R_PROFILE_USER=/dev/null
17+
# Force renv to use the Linux binaries for speed
18+
ENV RENV_CONFIG_REPOS_OVERRIDE="https://packagemanager.posit.co/cran/__linux__/noble/latest"
19+
1720
WORKDIR /project
1821

1922
# 4. Restore Packages (Cached Layer)
2023
COPY renv.lock .Rprofile ./
2124
COPY renv/activate.R renv/activate.R
2225

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

2629
RUN mkdir -p /opt/renv/library
27-
# Now renv::restore will work
30+
# Now renv::restore will work with the binary override
2831
RUN R -e "renv::restore(library='/opt/renv/library')"
2932

3033
# 5. Copy ALL Application Files
31-
# This ensures 3PodR.R, chapters/, R/, style.css, etc. are included
3234
COPY . .
3335

3436
# 6. Execution Logic
35-
# We force the symlink and run render_book.
36-
# Using index.Rmd ensures bookdown merges your chapters correctly.
3737
ENTRYPOINT ["sh", "-c", "ln -sf /project/$1 /project/configuration.yml && R --vanilla -e 'bookdown::render_book(\"index.Rmd\")'", "--"]
3838

3939
CMD ["configuration.yml"]

0 commit comments

Comments
 (0)