Dockerfile 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # Use DaoCloud mirrored vllm image for China region for gpu with Ampere、Ada Lovelace、Hopper architecture (8.0 <= Compute Capability <= 9.0)
  2. # Compute Capability version query (https://developer.nvidia.com/cuda-gpus)
  3. # only support x86_64 architecture
  4. FROM docker.m.daocloud.io/vllm/vllm-openai:v0.10.1.1
  5. # Use DaoCloud mirrored vllm image for China region for gpu with Volta、Turing、Blackwell architecture (7.0 < Compute Capability < 8.0 or Compute Capability >= 10.0)
  6. # support x86_64 architecture and ARM(AArch64) architecture
  7. # FROM docker.m.daocloud.io/vllm/vllm-openai:v0.11.0
  8. # 修复:配置 apt 源为国内镜像,并处理可能的网络问题
  9. RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list.d/debian.sources 2>/dev/null || \
  10. sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list && \
  11. sed -i 's/security.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list 2>/dev/null || true
  12. # Install libgl for opencv support & Noto fonts for Chinese characters
  13. RUN apt-get update && \
  14. apt-get install -y \
  15. libgl1-mesa-glx \
  16. libglib2.0-0 \
  17. libsm6 \
  18. libxext6 \
  19. libxrender-dev \
  20. libgomp1 \
  21. libqt5core5a \
  22. libqt5gui5 \
  23. libqt5widgets5 \
  24. fonts-noto-core \
  25. fonts-noto-cjk \
  26. fontconfig \
  27. libgl1 && \
  28. fc-cache -fv && \
  29. apt-get clean && \
  30. rm -rf /var/lib/apt/lists/*
  31. # 先安装 opencv-python-headless 避免 Qt 依赖
  32. RUN python3 -m pip install --no-cache-dir \
  33. opencv-python-headless \
  34. -i https://mirrors.aliyun.com/pypi/simple \
  35. --break-system-packages
  36. # 安装 mineru(跳过 opencv 依赖)
  37. RUN python3 -m pip install --no-cache-dir \
  38. 'mineru[core]>=2.7.0' \
  39. -i https://mirrors.aliyun.com/pypi/simple \
  40. --break-system-packages \
  41. --no-deps || true
  42. # Install mineru latest
  43. RUN python3 -m pip install -U 'mineru[core]>=2.7.0' -i https://mirrors.aliyun.com/pypi/simple --break-system-packages && \
  44. python3 -m pip cache purge
  45. # Download models and update the configuration file
  46. RUN /bin/bash -c "mineru-models-download -s modelscope -m all"
  47. # Set the entry point to activate the virtual environment and run the command line tool
  48. ENTRYPOINT ["/bin/bash", "-c", "export MINERU_MODEL_SOURCE=local && exec \"$@\"", "--"]