|
1 | 1 | # ActivationScope Dockerfile |
| 2 | +# Uses manylinux_2_28 base to produce wheels compatible with Python packaging standards. |
| 3 | +# PyPI rejects bare linux_x86_64 tags; wheels built here get proper manylinux_2_28_x86_64 tags. |
2 | 4 |
|
3 | | -# Stage‑0 build args — only visible to FROM lines below. |
4 | 5 | ARG PYTHON_VERSION=3.10 |
| 6 | +FROM quay.io/pypa/manylinux_2_28_x86_64 |
5 | 7 |
|
6 | | -FROM python:${PYTHON_VERSION}-slim |
7 | | - |
8 | | -# Re‑declare args so they are visible inside the build stage. |
| 8 | +# Re-declare args so they are visible inside the build stage. |
9 | 9 | ARG PYTORCH_VERSION=2.5.1 |
10 | 10 | ARG PLATFORM=cpu |
11 | 11 |
|
12 | | -RUN apt-get update && \ |
13 | | - apt-get install -y --no-install-recommends git g++ build-essential && \ |
14 | | - rm -rf /var/lib/apt/lists/* |
| 12 | +# manylinux is AlmaLinux 8 (RHEL-family) — use dnf, not apt-get. |
| 13 | +# Copy target Python and pip into /usr/local/bin so bare "python" / "pip" resolve correctly |
| 14 | +# for every subsequent RUN and for the CI wheel-build step on docker run. |
| 15 | +RUN dnf install -y gcc-c++ git && \ |
| 16 | + dnf clean all && \ |
| 17 | + PY="$(echo $PYTHON_VERSION | sed 's/3\.\([0-9]\)/cp3\1-cp3\1/')" && \ |
| 18 | + cp /opt/python/$PY/bin/pip /usr/local/bin/ && \ |
| 19 | + cp /opt/python/$PY/bin/python* /usr/local/bin/ && \ |
| 20 | + pip install --upgrade pip setuptools wheel |
15 | 21 |
|
16 | 22 | WORKDIR /src |
17 | 23 |
|
18 | 24 | # Generate pyproject.toml in-container (it is git-ignored and built dynamically) |
19 | 25 | COPY utils/generate-pyproject.py utils/matrix.py ./utils/ |
20 | 26 | COPY matrix.yml pyproject.toml.template setup.py ./ |
21 | 27 | RUN pip install --no-cache-dir pyyaml && python utils/generate-pyproject.py |
| 28 | + |
22 | 29 | COPY activationscope/ ./activationscope/ |
23 | 30 | COPY csrc/ ./csrc/ |
24 | 31 |
|
|
0 commit comments