npu.Dockerfile 1.3 KB

1234567891011121314151617181920212223242526272829
  1. # 基础镜像配置 vLLM 或 LMDeploy ,请根据实际需要选择其中一个,要求 ARM(AArch64) CPU + Ascend NPU。
  2. # Base image containing the vLLM inference environment, requiring ARM(AArch64) CPU + Ascend NPU.
  3. FROM quay.io/ascend/vllm-ascend:v0.11.0rc1
  4. # Base image containing the LMDeploy inference environment, requiring ARM(AArch64) CPU + Ascend NPU.
  5. # FROM crpi-4crprmm5baj1v8iv.cn-hangzhou.personal.cr.aliyuncs.com/lmdeploy_dlinfer/ascend:mineru-a2
  6. # Install libgl for opencv support & Noto fonts for Chinese characters
  7. RUN apt-get update && \
  8. apt-get install -y \
  9. fonts-noto-core \
  10. fonts-noto-cjk \
  11. fontconfig \
  12. libgl1 \
  13. libglib2.0-0 && \
  14. fc-cache -fv && \
  15. apt-get clean && \
  16. rm -rf /var/lib/apt/lists/*
  17. # Install mineru latest
  18. RUN python3 -m pip install -U pip -i https://mirrors.aliyun.com/pypi/simple && \
  19. python3 -m pip install -U 'mineru[core]>=2.6.5' -i https://mirrors.aliyun.com/pypi/simple && \
  20. python3 -m pip cache purge
  21. # Download models and update the configuration file
  22. RUN TORCH_DEVICE_BACKEND_AUTOLOAD=0 /bin/bash -c "mineru-models-download -s modelscope -m all"
  23. # Set the entry point to activate the virtual environment and run the command line tool
  24. ENTRYPOINT ["/bin/bash", "-c", "export MINERU_MODEL_SOURCE=local && exec \"$@\"", "--"]