-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.ubi9-tesseract
More file actions
36 lines (28 loc) · 1.18 KB
/
Dockerfile.ubi9-tesseract
File metadata and controls
36 lines (28 loc) · 1.18 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
ARG baseImage
FROM ${baseImage}
USER root
RUN INSTALL_PKGS="automake libtool gcc gcc-c++ cmake libjpeg-turbo-devel zlib-devel libwebp-devel libtiff-devel libpng-devel" && \
dnf -y --setopt=tsflags=nodocs install $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
dnf -y clean all --enablerepo='*'
USER ${USER}
ENV TESSERACT_VERSION=5.3.3
ENV LEPTONICA_VERSION=1.83.1
WORKDIR ${APP_ROOT}
ENV LOCAL=${APP_ROOT}/local
RUN curl -fsSL https://github.com/DanBloomberg/leptonica/releases/download/${LEPTONICA_VERSION}/leptonica-${LEPTONICA_VERSION}.tar.gz -O && \
tar xvfz leptonica-${LEPTONICA_VERSION}.tar.gz && \
cd leptonica-${LEPTONICA_VERSION} && \
./autogen.sh && \
./configure --enable-debug --prefix=${LOCAL} && \
make && \
make install
ENV LOCAL_LIB=${LOCAL}/lib
ENV PKG_CONFIG_PATH=${LOCAL_LIB}/pkgconfig
RUN curl -fsSL https://github.com/tesseract-ocr/tesseract/archive/${TESSERACT_VERSION}.tar.gz -O && \
tar xvfz ${TESSERACT_VERSION}.tar.gz && \
cd tesseract-${TESSERACT_VERSION} && \
./autogen.sh && \
./configure --prefix=${LOCAL} --with-extra-libraries=${LOCAL_LIB} --disable-openmp 'CXXFLAGS=-g -O2 -fno-math-errno -Wall -Wextra -Wpedantic' && \
make && \
make install