fix dockerfile for debian trixie
Browse files- Dockerfile +13 -5
Dockerfile
CHANGED
|
@@ -2,11 +2,16 @@ FROM python:3.10-slim
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
# Install system dependencies
|
|
|
|
|
|
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
-
libgl1
|
| 8 |
libglib2.0-0 \
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
| 10 |
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
# Copy requirements first for better caching
|
|
@@ -15,8 +20,11 @@ COPY requirements.txt .
|
|
| 15 |
# Install Python dependencies
|
| 16 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 17 |
|
| 18 |
-
# Fix onnxruntime executable stack issue
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
# Copy application code
|
| 22 |
COPY . .
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# Install system dependencies
|
| 6 |
+
# Note: libgl1 replaces libgl1-mesa-glx in newer Debian
|
| 7 |
+
# prelink contains execstack in some distros, but we'll use a different approach
|
| 8 |
RUN apt-get update && apt-get install -y \
|
| 9 |
+
libgl1 \
|
| 10 |
libglib2.0-0 \
|
| 11 |
+
libsm6 \
|
| 12 |
+
libxrender1 \
|
| 13 |
+
libxext6 \
|
| 14 |
+
binutils \
|
| 15 |
&& rm -rf /var/lib/apt/lists/*
|
| 16 |
|
| 17 |
# Copy requirements first for better caching
|
|
|
|
| 20 |
# Install Python dependencies
|
| 21 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 22 |
|
| 23 |
+
# Fix onnxruntime executable stack issue using objcopy (from binutils)
|
| 24 |
+
# This clears the executable stack requirement from the shared libraries
|
| 25 |
+
RUN for f in $(find /usr/local/lib/python3.10/site-packages/onnxruntime -name "*.so" 2>/dev/null); do \
|
| 26 |
+
objcopy --set-section-flags .note.GNU-stack=alloc,readonly $f 2>/dev/null || true; \
|
| 27 |
+
done
|
| 28 |
|
| 29 |
# Copy application code
|
| 30 |
COPY . .
|