Commit 7c167420 by 江名洋

修复错误

1 parent 38c43514
......@@ -3,8 +3,9 @@ FROM python:3.11-slim
# PyPI 镜像加速(清华源)
ENV PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple
# 运行时指定 OpenBLAS 使用兼容内核
ENV OPENBLAS_CORETYPE=PRESCOTT
# 运行时指定 OpenBLAS 使用最通用的内核 (Generic) 以避免 Illegal Instruction
# 之前的 PRESCOTT 可能在某些极其古老或虚拟化的 CPU 上仍有问题
ENV OPENBLAS_CORETYPE=Generic
WORKDIR /app
......@@ -14,12 +15,16 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
# 从源码编译 numpy:基线 SSE3(此 CPU 支持),禁止 dispatch 到 SSSE3+
# 从源码编译 numpy:基线 SSE3,禁止 dispatch
RUN pip install --no-cache-dir --no-binary=numpy numpy==1.26.4 \
-Csetup-args=-Dcpu-baseline=sse3 \
-Csetup-args=-Dcpu-dispatch=none
RUN pip install --no-cache-dir -r requirements.txt
# 验证关键库是否能正常导入(在构建阶段提前暴露 SIGILL)
RUN python -c "import numpy; print('numpy:', numpy.__version__)"
RUN python -c "import pandas; print('pandas:', pandas.__version__)"
RUN python -c "import pydantic_core; print('pydantic-core OK')"
COPY . .
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!