Ver código fonte

build(Dockerfile 调整):文件增加OpenCV 系统依赖库

lingmin_package@163.com 3 semanas atrás
pai
commit
db701c5883
1 arquivos alterados com 28 adições e 0 exclusões
  1. 28 0
      Dockerfile

+ 28 - 0
Dockerfile

@@ -1,5 +1,33 @@
 FROM python:3.12-slim
 
+# 安装 OpenCV 系统依赖(更完整的列表)
+RUN apt-get update && apt-get install -y \
+    # OpenCV 核心依赖
+    libgl1 \
+    libglib2.0-0 \
+    libsm6 \
+    libxext6 \
+    libxrender1 \
+    # X11 库(OpenCV 需要)
+    libxcb1 \
+    libxcb-shm0 \
+    libxcb-icccm4 \
+    libxcb-image0 \
+    libxcb-keysyms1 \
+    libxcb-randr0 \
+    libxcb-render-util0 \
+    libxcb-render0 \
+    libxcb-shape0 \
+    libxcb-sync1 \
+    libxcb-xfixes0 \
+    libxcb-xinerama0 \
+    libxcb-xkb1 \
+    libxkbcommon-x11-0 \
+    # 其他可能需要的库
+    libfontconfig1 \
+    libfreetype6 \
+    && rm -rf /var/lib/apt/lists/*
+
 ENV DEBIAN_FRONTEND=noninteractive \
     TZ=Asia/Shanghai