Repository navigation
Expand file tree
/
Copy pathDockerfile.base
More file actions
77 lines (66 loc) · 2.88 KB
/
Copy pathDockerfile.base
File metadata and controls
77 lines (66 loc) · 2.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# This is the reusable base ("dev") image, published to
# ghcr.io/ketchbrookanalytics/quarto-pdf-dev by
# .github/workflows/publish-image.yml. It is intentionally project-agnostic:
# the project-specific "prod" stage lives in the root Dockerfile and builds
# FROM this image.
# Define the version of R that we'll be using.
#
# Pinned to 4.5.x: R 4.6.0 breaks the vscode-R session watcher, so `View()` on a
# {gt} table (or any HTML widget) fails with "unable to start data viewer" in the
# devcontainer. See https://github.com/REditorSupport/vscode-R/issues/1696. A fix
# exists in the vscode-R development release; once it ships to the marketplace,
# this can move back to 4.6.x.
ARG R_VERSION=4.5.2
# Use the rocker/verse base image to install the specific version of R
FROM rocker/r-ver:${R_VERSION} AS dev
# Define the versions of the other software dependencies we'll be using
ARG QUARTO_VERSION=1.10.19
# Install fonts, along with the shared libraries that Chrome Headless Shell
# (installed below) needs at runtime to render mermaid/graphviz diagrams.
RUN apt-get update && apt-get install --no-install-recommends -y \
fonts-roboto \
fonts-noto-color-emoji \
wget \
libnss3 \
libnspr4 \
libatk1.0-0t64 \
libatk-bridge2.0-0t64 \
libatspi2.0-0t64 \
libdbus-1-3 \
libxcomposite1 \
libxdamage1 \
libxfixes3 \
libxrandr2 \
libxkbcommon0 \
libasound2t64 \
libgbm1 \
libcups2t64 \
libpango-1.0-0 \
libcairo2 \
&& rm -rf /var/lib/apt/lists/*
# Install Quarto, along with Chrome Headless Shell - Quarto's purpose-built
# headless browser (Chrome for Testing) used to render mermaid/graphviz
# diagrams. It ships native arm64 and amd64 Linux builds and needs no system
# Chrome/Chromium package, unlike the apt-based Chrome install this replaced.
ARG TARGETARCH
RUN wget -q "https://github.com/quarto-dev/quarto-cli/releases/download/v${QUARTO_VERSION}/quarto-${QUARTO_VERSION}-linux-${TARGETARCH}.deb" \
&& dpkg -i "quarto-${QUARTO_VERSION}-linux-${TARGETARCH}.deb" \
&& rm "quarto-${QUARTO_VERSION}-linux-${TARGETARCH}.deb" \
&& quarto install chrome-headless-shell --no-prompt
# Install the latest version of {pak}
RUN R -q -e "install.packages('pak')"
# Ensure we use {pak} on the backend with {renv} to install the packages in the
# lock file
ENV RENV_CONFIG_PAK_ENABLED=true
# Ensure we properly isolate "dev" packages installed in the Dev Container
ENV RENV_CONFIG_SANDBOX_ENABLED=false
# Don't automatically compare installed packages to lock file every new R
# session
ENV RENV_CONFIG_SYNCHRONIZED_CHECK=false
# Define the version of {renv} to install
ARG RENV_VERSION=1.2.3
# Install {renv}
# Note that we won't use {renv} to install packages during development;
# instead, we'll use {pak}. We'll only use {renv} during the pre-deployment
# process (see README for further instructions).
RUN R -q -e "pak::pkg_install('rstudio/renv@v${RENV_VERSION}')"