-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
93 lines (88 loc) · 2.39 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
FROM python:3.6
MAINTAINER Roman Myronov <warp.buddhist@gmail.com>
LABEL version=0.0.1
LABEL tesseract=4.0.0
LABEL opencv=3.2.0
LABEL imagemagick=true
LABEL leptonica=1.7.4.1
RUN apt-get update && \
apt-get install -y \
build-essential \
cmake \
git \
wget \
unzip \
yasm \
tesseract-ocr \
tesseract-ocr-eng \
libopencv-dev \
libtesseract-dev \
libleptonica-dev \
pkg-config \
libcv-dev \
python-opencv \
libswscale-dev \
libtbb2 \
libtbb-dev \
libjpeg-dev \
libpng-dev \
libtiff-dev \
libjasper-dev \
libavformat-dev \
autoconf automake libtool \
autoconf-archive \
pkg-config \
libpng12-dev \
libjpeg62-turbo-dev \
libtiff5-dev \
zlib1g-dev \
imagemagick \
libmagickwand-dev \
cython \
libpq-dev
WORKDIR /
RUN wget https://github.com/Itseez/opencv/archive/3.2.0.zip \
&& unzip 3.2.0.zip \
&& mkdir /opencv-3.2.0/cmake_binary \
&& cd /opencv-3.2.0/cmake_binary \
&& cmake -DBUILD_TIFF=ON \
-DBUILD_opencv_java=OFF \
-DWITH_CUDA=OFF \
-DENABLE_AVX=ON \
-DWITH_OPENGL=ON \
-DWITH_OPENCL=ON \
-DWITH_IPP=ON \
-DWITH_TBB=ON \
-DWITH_EIGEN=ON \
-DWITH_V4L=ON \
-DBUILD_TESTS=OFF \
-DBUILD_PERF_TESTS=OFF \
-DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_INSTALL_PREFIX=$(python3.6 -c "import sys; print(sys.prefix)") \
-DPYTHON_EXECUTABLE=$(which python3.6) \
-DPYTHON_INCLUDE_DIR=$(python3.6 -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())") \
-DPYTHON_PACKAGES_PATH=$(python3.6 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") .. \
&& make install \
&& rm /3.2.0.zip \
&& rm -r /opencv-3.2.0
RUN wget http://www.leptonica.com/source/leptonica-1.74.1.tar.gz \
&& tar -xvf leptonica-1.74.1.tar.gz \
&& cd leptonica-1.74.1 \
&& ./configure \
&& make \
&& make install \
&& cd .. \
&& rm -r leptonica-1.74.1 \
&& rm -r leptonica-1.74.1.tar.gz
RUN git clone https://github.com/tesseract-ocr/tesseract.git \
&& cd tesseract \
&& ./autogen.sh \
&& ./configure --enable-debug \
&& LDFLAGS="-L/usr/local/lib" CFLAGS="-I/usr/local/include" make \
&& make install \
&& ldconfig \
&& cd .. \
&& rm -r tesseract
RUN mkdir -p /app
WORKDIR /app
CMD ["python", "--version"]