5
votes

I am trying to create a docker file for tesseract-ocr ver 4.0. Following are the contents of the Docker file.

FROM ubuntu:16.04
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y software-properties- common && add-apt-repository -y ppa:alex-p/tesseract-ocr
RUN apt-get update && apt-get install -y tesseract-ocr

FROM python:3.6-alpine
ADD . /App
WORKDIR /App
COPY requirements.txt ./
COPY . .
RUN pip install --no-cache-dir -r requirements.txt

I am able to build the docker image, but when i spin a container and try to run a tesseract command i get "tesseract" not found.

I am not able to figure out what is wrong. Can someone please help.

1

1 Answers

11
votes
FROM ubuntu:18.04
RUN apt-get update \
    && apt-get install tesseract-ocr -y \
    python3 \
    #python-setuptools \
    python3-pip \
    && apt-get clean \
    && apt-get autoremove

ADD . /home/App
WORKDIR /home/App
COPY requirements.txt ./
COPY . .

RUN pip3 install -r requirements.txt

VOLUME ["/data"]
EXPOSE 5000 5000
CMD ["python3","OCRRun.py"]