feat: clean debian bookworm image and MPLCONFIGDIR for read-only rootfs

This commit is contained in:
bolbol committed 2026-11-10 00:22:48 +00:00
1 parent 17e2ec47b2
commit 2ab4f60a0f
2 files changed
+11 -19

No files matched your search

+10 -19
View File
@@ -1,10 +1,15 @@
# Étape 1 : Construction et installation des dépendances FROM debian:bookworm-slim
FROM python:3.11-slim AS builder
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
python3-pip \
python3-venv \
curl \ curl \
ca-certificates \ ca-certificates \
xz-utils \ xz-utils \
libfontconfig1 \
fonts-dejavu \
fonts-freefont-ttf \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Typst 0.15.1 officiel # Typst 0.15.1 officiel
@@ -13,23 +18,9 @@ RUN curl -sSL https://github.com/typst/typst/releases/download/v0.15.1/typst-x86
&& chmod +x /usr/local/bin/typst \ && chmod +x /usr/local/bin/typst \
&& rm -rf /tmp/typst* && rm -rf /tmp/typst*
WORKDIR /build COPY requirements.txt /tmp/
COPY requirements.txt /build/ RUN pip3 install --break-system-packages --no-cache-dir -r /tmp/requirements.txt \
RUN pip install --no-cache-dir -r requirements.txt && rm -f /tmp/requirements.txt
# Étape 2 : Image d'exécution propre sans variables GPG_KEY héritées
FROM debian:bookworm-slim
ENV PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
ENV MPLCONFIGDIR=/tmp/matplotlib
RUN apt-get update && apt-get install -y --no-install-recommends \
libfontconfig1 \
fonts-dejavu \
fonts-freefont-ttf \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /usr/local /usr/local
RUN groupadd -g 1005 gemini2-ops && useradd -u 1005 -g 1005 -m -s /bin/bash gemini2-ops RUN groupadd -g 1005 gemini2-ops && useradd -u 1005 -g 1005 -m -s /bin/bash gemini2-ops
+1
View File
@@ -7,6 +7,7 @@ ou résolution d'images existantes.
""" """
import os import os
os.environ.setdefault("MPLCONFIGDIR", "/tmp/matplotlib")
import shutil import shutil
import numpy as np import numpy as np
import matplotlib import matplotlib