1- FROM python:3.12-slim
1+ FROM ubuntu:24.04
2+
3+ # RK3588 (Cortex-A76/A55) is ARMv8.2-A — it does NOT support Pointer
4+ # Authentication (PAC, ARMv8.3-A). Debian Trixie ARM64 packages
5+ # (python:3.12-slim) are compiled with PAC guards; the kernel returns
6+ # ENOEXEC for those binaries on RK3588, causing "exec format error" at
7+ # container startup. Ubuntu 24.04 ARM64 packages do NOT use PAC and
8+ # run correctly on ARMv8.2-A hardware.
9+ ENV DEBIAN_FRONTEND=noninteractive
210
311RUN apt-get update \
4- && apt-get install -y --no-install-recommends libgomp1 wget curl sudo git build-essential \
5- && apt-get install -y ffmpeg libsm6 libxext6 \
12+ && apt-get install -y --no-install-recommends \
13+ python3.12 python3.12-dev python3-pip python3.12-venv \
14+ libgomp1 wget curl sudo git build-essential \
15+ ffmpeg libsm6 libxext6 \
616 && rm -rf /var/cache/apt/archives /var/lib/apt/lists/*
717
8- # Fix setupttols version to prevent error: No module named 'pkg_resources'
9- RUN python -m pip --no-cache-dir install "setuptools<82.0.0"
18+ # Use a virtual environment to avoid Ubuntu 24.04's PEP 668
19+ # "externally-managed-environment" restriction.
20+ RUN python3 -m venv /opt/venv
21+ ENV PATH="/opt/venv/bin:$PATH"
22+
23+ RUN pip install --no-cache-dir --upgrade pip \
24+ && pip install --no-cache-dir "setuptools<82.0.0"
1025
1126WORKDIR /opt/rkllama
1227
@@ -18,13 +33,13 @@ RUN chmod 755 /usr/lib/librkllmrt.so && ldconfig
1833COPY ./src/rkllama/lib/librknnrt.so /usr/lib/
1934RUN chmod 755 /usr/lib/librknnrt.so && ldconfig
2035
21- # Copy the source and other resourvces of the RKllama project
36+ # Copy the source and other resources of the RKllama project
2237COPY ./src /opt/rkllama/src
2338RUN mkdir /opt/rkllama/models
2439COPY README.md LICENSE pyproject.toml /opt/rkllama/
2540
26- # Install RKLlama project
27- RUN python -m pip --no-cache-dir install .
41+ # Install RKllama project
42+ RUN pip install --no-cache-dir .
2843
2944EXPOSE 8080
3045
0 commit comments