3v324v23 commited on
Commit
d75c806
·
1 Parent(s): efa9cfe

fix dockerfile for debian trixie

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -5
Dockerfile CHANGED
@@ -2,11 +2,16 @@ FROM python:3.10-slim
2
 
3
  WORKDIR /app
4
 
5
- # Install system dependencies including execstack
 
 
6
  RUN apt-get update && apt-get install -y \
7
- libgl1-mesa-glx \
8
  libglib2.0-0 \
9
- execstack \
 
 
 
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
- RUN find /usr/local/lib/python3.10/site-packages/onnxruntime -name "*.so" -exec execstack -c {} \; 2>/dev/null || true
 
 
 
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 . .