Skip to content

Commit 482defb

Browse files
committed
Docker: 修复 wheel 文件名问题
- 使用完整的 wheel 文件名而不是简写 - 使用 wget --spider 先检查文件是否存在 - 确保 pip 能正确识别 wheel 文件
1 parent 86bbd03 commit 482defb

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

packaging/Dockerfile

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,23 +66,25 @@ COPY . /app/
6666
ARG BUILD_TYPE=cpu
6767
RUN if [ "$BUILD_TYPE" = "gpu" ]; then \
6868
# GPU 版本:尝试下载预编译的 pydensecrf,如果失败则从源码编译
69-
if wget -q https://github.com/hgmzhn/manga-translator-ui/releases/download/v1.9.2/pydensecrf-1.0-cp312-cp312-linux_x86_64.whl -O /tmp/pydensecrf.whl 2>/dev/null && [ -f /tmp/pydensecrf.whl ]; then \
70-
echo "Using precompiled pydensecrf wheel" && \
71-
pip install --no-cache-dir /tmp/pydensecrf.whl; \
69+
if wget --spider -q https://github.com/hgmzhn/manga-translator-ui/releases/download/v1.9.2/pydensecrf-1.0-cp312-cp312-linux_x86_64.whl 2>/dev/null; then \
70+
echo "Downloading precompiled pydensecrf wheel" && \
71+
wget -q https://github.com/hgmzhn/manga-translator-ui/releases/download/v1.9.2/pydensecrf-1.0-cp312-cp312-linux_x86_64.whl -O /tmp/pydensecrf-1.0-cp312-cp312-linux_x86_64.whl && \
72+
pip install --no-cache-dir /tmp/pydensecrf-1.0-cp312-cp312-linux_x86_64.whl; \
7273
else \
73-
echo "Precompiled wheel not found, building from source" && \
74+
echo "Precompiled wheel not available, building from source" && \
7475
pip install --no-cache-dir Cython numpy && \
7576
pip install --no-cache-dir git+https://github.com/lucasb-eyer/pydensecrf.git; \
7677
fi && \
7778
grep -v "^pydensecrf" requirements_gpu.txt > /tmp/requirements_gpu_no_pydensecrf.txt && \
7879
pip install --no-cache-dir -r /tmp/requirements_gpu_no_pydensecrf.txt; \
7980
else \
8081
# CPU 版本:尝试下载预编译的 pydensecrf,如果失败则从源码编译
81-
if wget -q https://github.com/hgmzhn/manga-translator-ui/releases/download/v1.9.2/pydensecrf-1.0-cp312-cp312-linux_x86_64.whl -O /tmp/pydensecrf.whl 2>/dev/null && [ -f /tmp/pydensecrf.whl ]; then \
82-
echo "Using precompiled pydensecrf wheel" && \
83-
pip install --no-cache-dir /tmp/pydensecrf.whl; \
82+
if wget --spider -q https://github.com/hgmzhn/manga-translator-ui/releases/download/v1.9.2/pydensecrf-1.0-cp312-cp312-linux_x86_64.whl 2>/dev/null; then \
83+
echo "Downloading precompiled pydensecrf wheel" && \
84+
wget -q https://github.com/hgmzhn/manga-translator-ui/releases/download/v1.9.2/pydensecrf-1.0-cp312-cp312-linux_x86_64.whl -O /tmp/pydensecrf-1.0-cp312-cp312-linux_x86_64.whl && \
85+
pip install --no-cache-dir /tmp/pydensecrf-1.0-cp312-cp312-linux_x86_64.whl; \
8486
else \
85-
echo "Precompiled wheel not found, building from source" && \
87+
echo "Precompiled wheel not available, building from source" && \
8688
pip install --no-cache-dir Cython numpy && \
8789
pip install --no-cache-dir git+https://github.com/lucasb-eyer/pydensecrf.git; \
8890
fi && \

0 commit comments

Comments
 (0)