diff --git a/Dockerfile b/Dockerfile index 5dd36a8..910fa5b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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