Skip to content

Commit 5607f9f

Browse files
committed
added additional dev dependencies
1 parent 33d1901 commit 5607f9f

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

Dockerfile

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

4-
# 2. Install system dependencies (including cmake, nlopt, curl, and certificates)
4+
# 2. Install system dependencies (including cmake, nlopt, curl, certificates, and graphics libs)
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 \
1010
cmake libnlopt-dev curl ca-certificates \
11+
libx11-dev libxt-dev libxrender1 libxext6 libfontconfig1-dev libcairo2-dev \
1112
&& rm -rf /var/lib/apt/lists/*
1213

1314
# 3. Setup Environment
@@ -16,7 +17,6 @@ ENV RENV_PATHS_LIBRARY=/opt/renv/library
1617
ENV R_PROFILE_USER=/dev/null
1718
# Force renv to use Linux binaries for speed
1819
ENV RENV_CONFIG_REPOS_OVERRIDE="https://packagemanager.posit.co/cran/__linux__/noble/latest"
19-
# Force renv to install binaries where available
2020
ENV RENV_CONFIG_INSTALL_TYPE=binary
2121

2222
WORKDIR /project
@@ -26,12 +26,16 @@ COPY renv.lock .Rprofile ./
2626
COPY renv/activate.R renv/activate.R
2727

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

3131
RUN mkdir -p /opt/renv/library
3232

33-
# Restore packages to /opt/renv/library (binaries used via env variable)
34-
RUN R -e "renv::restore(library='/opt/renv/library')"
33+
# 4a. Pre-install stubborn packages to prevent restore failures
34+
RUN R -e "install.packages(c('ggrepel','patchwork','FactoMineR','ggpubr','factoextra','aplot','ggVennDiagram','PAVER'), \
35+
repos='https://packagemanager.posit.co/cran/__linux__/noble/latest')"
36+
37+
# 4b. Restore remaining packages (non-interactive)
38+
RUN R -e "renv::restore(library='/opt/renv/library', prompt=FALSE, clean=FALSE)"
3539

3640
# 5. Copy all application files
3741
COPY . .

0 commit comments

Comments
 (0)