Skip to content

Commit 8f81d51

Browse files
author
Susan Vanderplas
committed
Force java to behave?
1 parent 96248c8 commit 8f81d51

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ jobs:
6666
-v "${HOME}/.cache/pip:/root/.cache/pip" \
6767
-e RENV_PATHS_CACHE=/root/.local/share/renv \
6868
-e PIP_CACHE_DIR=/root/.cache/pip \
69+
-e QUARTO_PYTHON="venv" \
6970
-e NEWSAPI_KEY="${{ secrets.NEWSAPI_KEY }}" \
7071
-e GH_APP_ID="${{ secrets.GH_APP_ID }}" \
7172
-e GH_APP_SECRET="${{ secrets.GH_APP_SECRET }}" \

Dockerfile

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,23 @@ RUN --mount=type=cache,target=/var/cache/apt \
1212
apt-get update && apt-get install -y --no-install-recommends \
1313
python3 python3-pip python3-venv python3-dev \
1414
libcurl4-openssl-dev libssl-dev libxml2-dev \
15-
default-jdk \
15+
default-jdk default-jre r-cran-rjava unixodbc unixodbc-dev \
1616
libtesseract-dev libpoppler-cpp-dev tesseract-ocr \
1717
libleptonica-dev libpng-dev libjpeg-dev libtiff-dev \
1818
imagemagick gdal-bin libgdal-dev libsecret-1-dev \
1919
libglpk-dev libudunits2-dev \
2020
curl gnupg ca-certificates \
21-
&& rm -rf /var/lib/apt/lists/*
21+
&& rm -rf /var/lib/apt/lists/* \
22+
&& install2.r --error --deps TRUE \
23+
RJDBC odbc tinytex quarto devtools rmarkdown rstudioapi reticulate yaml digest \\
24+
&& Rscript -e "tinytex::install_tinytex(force=T)"
25+
26+
ENV JAVA_HOME=/usr/lib/jvm/default-java/
27+
ENV PATH="${JAVA_HOME}/bin:${PATH}"
28+
ENV LD_LIBRARY_PATH="${JAVA_HOME}/lib/server:${LD_LIBRARY_PATH}"
29+
30+
# Verify Java install
31+
RUN java -version && javac -version
2232

2333
# --- Layer 2: GitHub CLI
2434
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \
@@ -34,12 +44,11 @@ RUN curl -fsSL https://quarto.org/download/latest/quarto-linux-amd64.deb -o /tmp
3444
apt-get update && apt-get install -y /tmp/quarto.deb && rm -f /tmp/quarto.deb && \
3545
rm -rf /var/lib/apt/lists/*
3646

37-
# --- Layer 4: TinyTeX
38-
RUN Rscript -e "install.packages('tinytex', repos='https://cloud.r-project.org'); tinytex::install_tinytex(force=T)"
39-
47+
# --- Layer 4: Check cache dirs
4048
# Ensure cache dirs exist
4149
RUN mkdir -p ${RENV_PATHS_CACHE} ${PIP_CACHE_DIR} /root/.virtualenvs
4250

51+
4352
WORKDIR /project
4453

4554
# Default command: render and publish

0 commit comments

Comments
 (0)