|
1 | | -FROM debian:bookworm-slim |
| 1 | +FROM debian:trixie-slim |
2 | 2 |
|
3 | 3 | ENV DEBIAN_FRONTEND=noninteractive |
4 | 4 |
|
5 | | -# Install system dependencies |
6 | | -RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 5 | +# apt upgrade pulls security fixes past the base-image snapshot. |
| 6 | +# Fonts: the OFL families the Typst template falls through to (Lato, JetBrains |
| 7 | +# Mono, Carlito for Calibri, Liberation Sans for Arial, DejaVu mono). |
| 8 | +# python-is-python3: the workflows invoke bare `python`. |
| 9 | +# unzip: required by `quarto install chrome-headless-shell` (below) to extract. |
| 10 | +# rsync: github-pages-deploy-action shells out to it to sync the build. |
| 11 | +# lib* : runtime deps for chrome-headless-shell, which Quarto uses to |
| 12 | +# rasterize mermaid/dot diagrams during the Typst PDF render. |
| 13 | +RUN apt-get update && apt-get upgrade -y && apt-get install -y --no-install-recommends \ |
7 | 14 | wget \ |
8 | | - curl \ |
9 | | - sudo \ |
10 | 15 | git \ |
11 | 16 | bash \ |
12 | | - rsync \ |
13 | 17 | ca-certificates \ |
14 | 18 | python3 \ |
15 | 19 | python3-pip \ |
16 | | - fonts-dejavu \ |
| 20 | + python-is-python3 \ |
| 21 | + unzip \ |
| 22 | + rsync \ |
| 23 | + fonts-dejavu-core \ |
| 24 | + fonts-lato \ |
| 25 | + fonts-jetbrains-mono \ |
| 26 | + fonts-crosextra-carlito \ |
| 27 | + fonts-liberation2 \ |
17 | 28 | coreutils \ |
18 | | - procps \ |
19 | | - chromium \ |
20 | | - libreoffice-core \ |
21 | | - libreoffice-writer \ |
22 | | - libreoffice-java-common \ |
23 | | - default-jre-headless |
| 29 | + libnss3 libnspr4 libdbus-1-3 libglib2.0-0t64 libatk1.0-0t64 \ |
| 30 | + libatk-bridge2.0-0t64 libatspi2.0-0t64 libcups2t64 libdrm2 libgbm1 \ |
| 31 | + libxcb1 libx11-6 libxcomposite1 libxdamage1 libxext6 libxfixes3 \ |
| 32 | + libxrandr2 libxkbcommon0 libasound2t64 libpango-1.0-0 libcairo2 && \ |
| 33 | + apt-get clean && \ |
| 34 | + rm -rf /var/lib/apt/lists/* \ |
| 35 | + /usr/share/doc /usr/share/man /usr/share/locale \ |
| 36 | + /var/cache/* /tmp/* /var/tmp/* |
24 | 37 |
|
25 | 38 |
|
26 | | -# Install Quarto CLI |
| 39 | +# Install Quarto CLI. |
| 40 | +ENV QUARTO_VERSION=1.9.37 |
27 | 41 | RUN arch=$(dpkg --print-architecture) && \ |
28 | 42 | case "$arch" in \ |
29 | | - amd64) deb=quarto-1.7.30-linux-amd64.deb ;; \ |
30 | | - arm64) deb=quarto-1.7.30-linux-arm64.deb ;; \ |
31 | | - *) echo "Unsupported architecture: $arch" && exit 1 ;; \ |
| 43 | + amd64) deb=quarto-${QUARTO_VERSION}-linux-amd64.deb ;; \ |
| 44 | + arm64) deb=quarto-${QUARTO_VERSION}-linux-arm64.deb ;; \ |
| 45 | + *) echo "Unsupported architecture: $arch" && exit 1 ;; \ |
32 | 46 | esac && \ |
33 | | - wget https://github.com/quarto-dev/quarto-cli/releases/download/v1.7.30/$deb && \ |
| 47 | + wget -q https://github.com/quarto-dev/quarto-cli/releases/download/v${QUARTO_VERSION}/$deb && \ |
34 | 48 | dpkg -i $deb && \ |
35 | | - rm $deb |
36 | | - |
37 | | -# Install Node.js (for GitHub Actions written in Node) |
38 | | -RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \ |
39 | | - apt-get install -y nodejs |
40 | | - |
41 | | -# Clean up apt, pip, Python, and docs |
42 | | -RUN apt-get clean && \ |
43 | | - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ |
44 | | - python3 -m pip cache purge && \ |
45 | | - find /usr/local/lib/python3.*/ -name '__pycache__' -exec rm -r {} + && \ |
46 | | - find /usr/local/lib/python3.*/ -name '*.pyc' -delete && \ |
47 | | - rm -rf /root/.cache/pip /root/.cache/fontconfig && \ |
48 | | - rm -rf $HF_HOME/hub/tmp-* $HF_HOME/hub/*.lock $HF_HOME/hub/models--*/blobs &&\ |
49 | | - rm -rf /usr/share/doc /usr/share/man /usr/share/locale /var/cache/* /tmp/* /var/tmp/* |
| 49 | + rm $deb && \ |
| 50 | + rm -rf /usr/share/doc /usr/share/man /tmp/* /var/tmp/* |
| 51 | + |
| 52 | +# panflute -> inject_changelog.py filter |
| 53 | +# PyYAML -> strip_unknown_frontmatter.py + the AI scripts |
| 54 | +# google-genai -> helpers/gemini_client.py (LLM doc annotation, 2.x; uses |
| 55 | +# files.upload(file=), see gemini_client.py) |
| 56 | +# tiktoken -> token counting for the LLM rate limiter |
| 57 | +RUN pip install --no-cache-dir --break-system-packages \ |
| 58 | + panflute PyYAML google-genai==2.6.0 tiktoken==0.13.0 && \ |
| 59 | + python3 -m pip cache purge 2>/dev/null || true && \ |
| 60 | + rm -rf /root/.cache /tmp/* /var/tmp/* |
| 61 | + |
| 62 | + |
| 63 | +# Pin Quarto's data dir to a fixed path so it finds chrome-headless-shell at |
| 64 | +# runtime regardless of $HOME. GitHub container jobs set HOME=/github/home, |
| 65 | +# which would otherwise hide this install and break the Typst diagram render. |
| 66 | +ENV XDG_DATA_HOME=/root/.local/share |
| 67 | + |
| 68 | +# Headless browser Quarto uses to rasterize mermaid/dot diagrams during the |
| 69 | +# Typst PDF render. Needs unzip + the lib* packages installed above. |
| 70 | +RUN quarto install chrome-headless-shell && \ |
| 71 | + rm -rf /root/.cache /tmp/* /var/tmp/* |
| 72 | + |
| 73 | +# Fail the build early if the headless browser can't actually launch (e.g. a |
| 74 | +# missing runtime lib): render a trivial mermaid doc to PDF. |
| 75 | +RUN cd /tmp && \ |
| 76 | + printf '```{mermaid}\nflowchart LR\n A --> B\n```\n' > smoke.qmd && \ |
| 77 | + quarto render smoke.qmd --to typst -o smoke.pdf && \ |
| 78 | + rm -rf /tmp/smoke* /root/.cache |
50 | 79 |
|
51 | 80 |
|
52 | 81 | # Entrypoint script |
|
0 commit comments