forked from mobilelife/docker-python-opencv-tesseract
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
53 lines (41 loc) · 1.44 KB
/
Dockerfile
File metadata and controls
53 lines (41 loc) · 1.44 KB
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
# TODO: FROM docker-python-opencv
FROM dbmobilelife/docker-python-opencv
WORKDIR /tmp/thework
ARG BUILD_PACKAGES="autoconf \
automake \
g++ \
libtool \
libjpeg8-dev \
libpng12-dev \
libtiff5-dev \
pkg-config \
zlib1g-dev"
ARG EXTRA_PACKAGES="autotools-dev \
binutils cpp cpp-5 dpkg-dev file g++-5 gcc gcc-5 libc-dev-bin libc6-dev \
libcc1-0 libcilkrts5 libdpkg-perl libgcc-5-dev libjbig-dev libjpeg-turbo8-dev \
liblzma-dev libstdc++-5-dev linux-libc-dev m4 make patch"
RUN apt-get update \
&& apt-get install -y --no-install-recommends $BUILD_PACKAGES
ADD ./temp/leptonica-1.73.tar.gz .
ADD ./temp/tesseract-master.tar.gz .
# build and install leptonica
RUN cd ./leptonica-1.73 \
&& ./configure \
&& make -j2 \
&& make install \
&& cd ..
# build and install tesseract 4
RUN cd ./tesseract-master \
&& ./autogen.sh LIBLEPT_HEADERSDIR=/usr/local/lib --with-extra-libraries=/usr/local/lib \
&& ./configure \
&& make -j2 \
&& make install \
&& ldconfig
RUN apt-get install -y python-setuptools
RUN pip install pytesseract pillow
# Cleanup
RUN apt-get purge -y $BUILD_PACKAGES $EXTRA_PACKAGES \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/thework/*
# Download english tesseract model
ADD ./temp/eng.traineddata /usr/local/share/tessdata/