1- # Fast, sane base with R + tools
21FROM rocker/verse:4.5
32
43ENV DEBIAN_FRONTEND=noninteractive
5- # Default cache locations (can be overridden at runtime)
64ENV RENV_PATHS_CACHE=/root/.local/share/renv \
75 PIP_CACHE_DIR=/root/.cache/pip
86
9- # --- Layer 1: OS deps (cacheable)
7+ # --- Layer 1: OS deps (cacheable with BuildKit )
108RUN --mount=type=cache,target=/var/cache/apt \
119 --mount=type=cache,target=/var/lib/apt \
1210 apt-get update && apt-get install -y --no-install-recommends \
@@ -19,7 +17,7 @@ RUN --mount=type=cache,target=/var/cache/apt \
1917 curl gnupg ca-certificates \
2018 && rm -rf /var/lib/apt/lists/*
2119
22- # --- Layer 2: GitHub CLI (optional)
20+ # --- Layer 2: GitHub CLI
2321RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \
2422 | dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg && \
2523 chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg && \
@@ -28,21 +26,18 @@ RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \
2826 apt-get update && apt-get install -y gh && \
2927 rm -rf /var/lib/apt/lists/*
3028
31- # --- Layer 3: Quarto
29+ # --- Layer 3: Quarto CLI
3230RUN curl -fsSL https://quarto.org/download/latest/quarto-linux-amd64.deb -o /tmp/quarto.deb && \
3331 apt-get update && apt-get install -y /tmp/quarto.deb && rm -f /tmp/quarto.deb && \
3432 rm -rf /var/lib/apt/lists/*
3533
36- # --- Layer 4: TinyTeX (LaTeX)
34+ # --- Layer 4: TinyTeX
3735RUN Rscript -e "install.packages('tinytex', repos='https://cloud.r-project.org'); tinytex::install_tinytex()"
3836
39- # Optional: a couple of helper R packages used during checks
40- RUN Rscript -e "install.packages(c('digest'), repos='https://cloud.r-project.org')"
41-
42- # Ensure cache dirs always exist (first-run safe)
37+ # Ensure cache dirs exist
4338RUN mkdir -p ${RENV_PATHS_CACHE} ${PIP_CACHE_DIR} /root/.virtualenvs
4439
4540WORKDIR /project
4641
47- # Default command: render then publish
42+ # Default command: render and publish
4843CMD ["/bin/sh" ,"-c" ,"quarto render && quarto publish" ]
0 commit comments