马一丁

Update Dockerfile

Showing 1 changed file with 39 additions and 31 deletions
@@ -10,37 +10,45 @@ ENV PYTHONDONTWRITEBYTECODE=1 \ @@ -10,37 +10,45 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
10 PLAYWRIGHT_BROWSERS_PATH=/ms-playwright 10 PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
11 11
12 # Install system dependencies required by scientific Python stack, Playwright, Streamlit, and WeasyPrint PDF 12 # Install system dependencies required by scientific Python stack, Playwright, Streamlit, and WeasyPrint PDF
13 -RUN apt-get update && apt-get install -y --no-install-recommends \  
14 - build-essential \  
15 - curl \  
16 - git \  
17 - libgl1 \  
18 - libglib2.0-0 \  
19 - libgtk-3-0 \  
20 - libpango-1.0-0 \  
21 - libpangocairo-1.0-0 \  
22 - libpangoft2-1.0-0 \  
23 - libgdk-pixbuf2.0-0 \  
24 - libffi-dev \  
25 - libcairo2 \  
26 - libatk1.0-0 \  
27 - libatk-bridge2.0-0 \  
28 - libxcb1 \  
29 - libxcomposite1 \  
30 - libxdamage1 \  
31 - libxext6 \  
32 - libxfixes3 \  
33 - libxi6 \  
34 - libxtst6 \  
35 - libnss3 \  
36 - libxrandr2 \  
37 - libxkbcommon0 \  
38 - libasound2 \  
39 - libx11-xcb1 \  
40 - libxshmfence1 \  
41 - libgbm1 \  
42 - ffmpeg \  
43 - && apt-get clean && rm -rf /var/lib/apt/lists/* 13 +RUN set -euo pipefail; \
  14 + apt-get update; \
  15 + if apt-cache show libgdk-pixbuf-2.0-0 >/dev/null 2>&1; then \
  16 + GDK_PIXBUF_PKG=libgdk-pixbuf-2.0-0; \
  17 + else \
  18 + GDK_PIXBUF_PKG=libgdk-pixbuf2.0-0; \
  19 + fi; \
  20 + apt-get install -y --no-install-recommends \
  21 + build-essential \
  22 + curl \
  23 + git \
  24 + libgl1 \
  25 + libglib2.0-0 \
  26 + libgtk-3-0 \
  27 + libpango-1.0-0 \
  28 + libpangocairo-1.0-0 \
  29 + libpangoft2-1.0-0 \
  30 + "${GDK_PIXBUF_PKG}" \
  31 + libffi-dev \
  32 + libcairo2 \
  33 + libatk1.0-0 \
  34 + libatk-bridge2.0-0 \
  35 + libxcb1 \
  36 + libxcomposite1 \
  37 + libxdamage1 \
  38 + libxext6 \
  39 + libxfixes3 \
  40 + libxi6 \
  41 + libxtst6 \
  42 + libnss3 \
  43 + libxrandr2 \
  44 + libxkbcommon0 \
  45 + libasound2 \
  46 + libx11-xcb1 \
  47 + libxshmfence1 \
  48 + libgbm1 \
  49 + ffmpeg; \
  50 + apt-get clean; \
  51 + rm -rf /var/lib/apt/lists/*
44 52
45 # Install the latest uv release and expose it on PATH 53 # Install the latest uv release and expose it on PATH
46 RUN curl -LsSf --retry 3 --retry-delay 2 --proto '=https' --proto-redir '=https' --tlsv1.2 https://astral.sh/uv/install.sh | sh 54 RUN curl -LsSf --retry 3 --retry-delay 2 --proto '=https' --proto-redir '=https' --tlsv1.2 https://astral.sh/uv/install.sh | sh