dockerfile安装opencv
时间: 2023-11-10 11:01:54 浏览: 304
OpenCV2.4.4安装教程
5星 · 资源好评率100%
可以通过以下Dockerfile安装OpenCV:
```
FROM python:3.8-slim-buster
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
libgtk2.0-dev \
pkg-config \
libavcodec-dev \
libavformat-dev \
libswscale-dev \
python3-dev \
libtbb2 \
libtbb-dev \
libjpeg-dev \
libpng-dev \
libtiff-dev \
libdc1394-22-dev
RUN pip install opencv-python
CMD ["/bin/bash"]
```
上述Dockerfile中,我们首先基于Python3.8的镜像构建Docker镜像,在Docker镜像中安装OpenCV所需的依赖项,然后通过pip安装OpenCV。
阅读全文