This commit is contained in:
hailin 2025-07-02 13:14:51 +08:00
parent 29fbdc2cfa
commit d5b8242ecc
1 changed files with 6 additions and 6 deletions

View File

@ -41,8 +41,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
python3 -m pip install --no-cache-dir --upgrade pip wheel setuptools
# ── 安装自编 torch 轮子 ──────────────────────────────────────────────────────
COPY --from=builder-torch /opt/pytorch/dist/torch-2.7.1+cu126*.whl /tmp/
RUN python3 -m pip install --no-cache-dir /tmp/torch-2.7.1+cu126*.whl && rm /tmp/*.whl
COPY --from=builder-torch /opt/pytorch/dist /tmp/torch_dist
RUN python3 -m pip install --no-cache-dir $(find /tmp/torch_dist -name "torch-2.7.1+cu126*.whl") && rm -rf /tmp/torch_dist
# ── 编译 torchvision 0.22.1 (依赖本地 torch) ────────────────────────────────
WORKDIR /opt
@ -64,10 +64,10 @@ RUN python3 -m pip install ".[srt,openai]" --no-build-isolation && \
# ── 收集所有 wheel 到 /wheels ──────────────────────────────────────────────
RUN mkdir -p /wheels && \
cp /opt/pytorch/dist/torch-2.7.1+cu126*.whl /wheels/ && \
cp /opt/vision/dist/torchvision-0.22.1+cu126*.whl /wheels/ && \
cp /opt/flashinfer/python/dist/flashinfer_python-*.whl /wheels/ && \
cp /tmp/sg_wheels/sglang-*.whl /wheels/
cp /tmp/torch_dist/torch*.whl /wheels/ && \
cp /opt/vision/dist/torchvision-0.22.1+cu126*.whl /wheels/ && \
cp /opt/flashinfer/python/dist/flashinfer_python-*.whl /wheels/ && \
cp /tmp/sg_wheels/sglang-*.whl /wheels/
###############################################################################
# Stage 2 ─ runtime极简运行镜像仅离线安装 wheel