Python with tesseract 4 on Ubuntu 16.04.
181
ARG UBUNTU_VERSION=16.04
FROM ubuntu:${UBUNTU_VERSION}
# install python3 and python3 dev
RUN apt-get update -y
RUN apt-get install -y python3-pip python3-dev
# open cv dependency
RUN apt-get install -y libglib2.0-0 libsm6 libxext6 libxrender1 libfontconfig1
# pdf2image dependency to convert pdf to images
RUN apt-get install -y poppler-utils
# dont write python byte code , to intergrate with gitlab CI with docker-compose
ENV PYTHONDONTWRITEBYTECODE=1
# Ubuntu 18.04 have tesseract-ocr v4 in the main repository, for 16.04, ddding repository.
RUN if [ "16.4" = "16.4" ]; then \
echo "VERSION ${UBUNTU_VERSION}. Adding repository for tesseract 4." \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CEF9E52D \
&& echo "deb http://ppa.launchpad.net/alex-p/tesseract-ocr/ubuntu xenial main\ndeb-src http://ppa.launchpad.net/alex-p/tesseract-ocr/ubuntu xenial main " >> /etc/apt/sources.list; \
else \
echo "VERSION ${UBUNTU_VERSION}. Skipping repository adding."; \
fi \
&& apt-get update \
&& apt-get install tesseract-ocr -y \
&& apt-get clean \
&& apt-get autoremove
Content type
Image
Digest
Size
210.8 MB
Last updated
over 7 years ago
docker pull bkrmdahal/python_tesseract:1.0-ubuntu