luoyutianyang commited on
Commit
0814268
·
verified ·
1 Parent(s): 903639d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +2 -8
Dockerfile CHANGED
@@ -2,7 +2,7 @@
2
  FROM node:latest
3
 
4
  # 添加 Python3 和相关工具
5
- RUN apt-get update && apt-get install -y python3 python3-pip python3.12-venv
6
 
7
  # 安装必要的工具和依赖包
8
  RUN apt-get update && apt-get install -y \
@@ -29,12 +29,6 @@ RUN apt-get update && apt-get install -y \
29
  # 添加 node-gyp 全局
30
  RUN npm install -g node-gyp
31
 
32
- # 环境变量设置
33
- ENV OPENCV4NODEJS_DISABLE_AUTOBUILD=1
34
- ENV OPENCV_INCLUDE_DIR=/usr/local/include/opencv4
35
- ENV OPENCV_LIB_DIR=/usr/local/lib
36
- ENV OPENCV_BIN_DIR=/usr/local/bin
37
-
38
  # 创建工作目录并克隆 OpenCV 的源码库
39
  WORKDIR /app
40
  RUN git clone --depth 1 https://github.com/opencv/opencv.git ./opencv
@@ -44,7 +38,7 @@ WORKDIR /app/build
44
  RUN cmake -D WITH_FFMPEG=ON -D WITH_GSTREAMER=ON -D WITH_V4L=ON -D WITH_LIBV4L=ON -D WITH_GTK=ON -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ../opencv
45
 
46
  # 使用并行编译进程
47
- RUN make -j$(nproc)
48
  RUN make install
49
 
50
  # 全部复制到工作目录
 
2
  FROM node:latest
3
 
4
  # 添加 Python3 和相关工具
5
+ RUN apt-get update && apt-get install -y python3 python3-pip python3.11-venv
6
 
7
  # 安装必要的工具和依赖包
8
  RUN apt-get update && apt-get install -y \
 
29
  # 添加 node-gyp 全局
30
  RUN npm install -g node-gyp
31
 
 
 
 
 
 
 
32
  # 创建工作目录并克隆 OpenCV 的源码库
33
  WORKDIR /app
34
  RUN git clone --depth 1 https://github.com/opencv/opencv.git ./opencv
 
38
  RUN cmake -D WITH_FFMPEG=ON -D WITH_GSTREAMER=ON -D WITH_V4L=ON -D WITH_LIBV4L=ON -D WITH_GTK=ON -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local ../opencv
39
 
40
  # 使用并行编译进程
41
+ RUN make -j16
42
  RUN make install
43
 
44
  # 全部复制到工作目录