首页 > 解决方案 > 如何为依赖 Caffe、OpenCV 的 python 项目编写 Dockerfile

问题描述

如何构建具有多个依赖项的 Docker 映像,例如Berkeley CaffeOpenCV.

这是我的 Dockerfile :

FROM ubuntu:18.04
RUN apt-get update && apt-get install \ python-pip python-virtualenv tesseract-ocr poppler-utils

RUN python -m virtualenv --python=/usr/bin/python /opt/venv

#Install dependencies:
COPY requirements.txt .
RUN . /opt/venv/bin/activate && pip install -r requirements.txt

#Install caffe -cpu only
#compile caffe localy 
#install all req of caffe
#run all make commands and also run make pycaffe

#set the python path

#Run
$ cd API
$ ../bin/gunicorn --pythonpath "/opt/venv/caffe/python" -b localhost:5000 app

标签: pythondocker

解决方案


推荐阅读