Commit 5eec72f7515160c11f8535fd668cb97731b1b304

Authored by Guilherme Andrade Del Cantoni
1 parent 837c6894

Reorganização do arquivo Dockerfile

Showing 1 changed file with 23 additions and 40 deletions   Show diff stats
Dockerfile
... ... @@ -6,17 +6,20 @@ COPY usr/local/bin/ocr /usr/local/bin/ocr
6 6 COPY etc/init.d/ocr-ubuntu /etc/init.d/ocr
7 7 COPY entrypoint.sh /entrypoint.sh
8 8  
9   -RUN apt-get -y update
10   -RUN apt-get -y install build-essential cmake libtool yasm pkg-config subversion git libgcj14 apt-utils
11   -RUN apt-get -y install curl
12   -RUN apt-get -y install libtiff-dev libpng-dev libopenjpeg-dev libjpeg8-dev libjpeg-turbo8-dev libjpeg-dev libgif-dev zlib1g-dev libicu-dev libpango1.0-dev libcairo2-dev libfontconfig1-dev libgettextpo-dev libnss3-dev
  9 +RUN apt-get -y update && \
  10 + apt-get -y install build-essential cmake libtool yasm pkg-config subversion git libgcj14 apt-utils \
  11 + curl libtiff-dev libpng-dev libopenjpeg-dev libjpeg8-dev libjpeg-turbo8-dev libjpeg-dev libgif-dev \
  12 + zlib1g-dev libicu-dev libpango1.0-dev libcairo2-dev libfontconfig1-dev libgettextpo-dev libnss3-dev \
  13 + wget cabextract xfonts-utils perl automake autoconf-archive libcurl4-gnutls-dev unzip libgcj14 \
  14 + libfile-find-rule-perl libfile-find-rule-perl-perl imagemagick gettext unpaper libtiff5 libpng12-0 \
  15 + libjpeg-turbo8 libpango1.0-0 libcairo2 fontconfig libwebp5 libfontconfig1 libgettextpo0 pkg-config gcc gcj-jdk \
  16 + rsyslog libsys-syslog-perl && \
  17 + apt-get -y clean all
13 18  
14   -RUN apt-get -y install wget cabextract xfonts-utils
15 19 RUN wget -O mscorefonts.deb http://ftp.us.debian.org/debian/pool/contrib/m/msttcorefonts/ttf-mscorefonts-installer_3.4+nmu1_all.deb && \
16 20 dpkg -i mscorefonts.deb
17 21  
18 22 # Instalação do Perl 5.1 e demais módulos
19   -RUN apt-get -y install perl
20 23 RUN perl -MCPAN -e 'install File::Touch'
21 24 RUN perl -MCPAN -e 'install File::Find::Rule;'
22 25 RUN perl -MCPAN -e 'install File::Touch;'
... ... @@ -26,58 +29,38 @@ RUN perl -MCPAN -e 'install IO::Select;'
26 29  
27 30 # Tesseract-ocr 3.05, com dicionários inglês e português
28 31 # Bibliotecas para o Tesseract: Leptonica
29   -RUN git clone https://github.com/DanBloomberg/leptonica.git
30   -RUN apt-get -y install automake
31   -RUN cd leptonica && ./autobuild && ./configure && make all install
  32 +RUN git clone https://github.com/DanBloomberg/leptonica.git && \
  33 + cd leptonica && ./autobuild && ./configure && make all install
32 34  
33 35 # Bibliotecas para o Tesseract: Libav
34   -RUN git clone https://github.com/libav/libav.git
35   -RUN export PKG_CONFIG_PATH=/usr/lib:/usr/local/lib:/usr/local/src/leptonica/ && \
36   - cd libav && ./configure --enable-sram && make all install -w
  36 +RUN git clone https://github.com/libav/libav.git && \
  37 + export PKG_CONFIG_PATH=/usr/lib:/usr/local/lib:/usr/local/src/leptonica/ && \
  38 + cd libav && ./configure --enable-sram && make all install
37 39  
38 40 # Tesseract
39   -RUN git clone https://github.com/tesseract-ocr/tesseract.git
40   -RUN apt-get -y install autoconf-archive
41   -RUN cd tesseract && ./autogen.sh && ./configure && make all install
  41 +RUN git clone https://github.com/tesseract-ocr/tesseract.git && \
  42 + cd tesseract && ./autogen.sh && ./configure && make all install
42 43  
43   -#RUN git clone https://github.com/tesseract-ocr/tessdata.git
44   -#RUN cp -avR tessdata/* /usr/local/share/tessdata/
45 44 RUN wget https://github.com/tesseract-ocr/tessdata/blob/master/eng.traineddata?raw=true -O /usr/local/share/tessdata/eng.traineddata && \
46 45 wget https://github.com/tesseract-ocr/tessdata/blob/master/por.traineddata?raw=true -O /usr/local/share/tessdata/por.traineddata && \
47 46 wget https://github.com/tesseract-ocr/tessdata/blob/master/osd.traineddata?raw=true -O /usr/local/share/tessdata/osd.traineddata
48 47  
49   -# export LIBCURL_LIBS=/usr/lib/x86_64-linux-gnu/ && \
50   -RUN apt-get -y install libcurl4-gnutls-dev
51   -RUN git clone https://anongit.freedesktop.org/git/poppler/poppler.git && \
  48 +RUN git clone -b poppler-0.56 https://anongit.freedesktop.org/git/poppler/poppler.git && \
52 49 cd poppler && ./autogen.sh && ./configure --enable-cmyk --enable-libcurl && make all install && cd ..
53 50  
54 51 # pdftk, versão 2.02 ou superior
55   -RUN wget https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk-2.02-src.zip
56   -RUN apt-get -y install unzip libgcj14
57   -RUN unzip pdftk-2.02-src.zip && rm -f pdftk-2.02-src.zip
58   -
59   -RUN apt-get -y update
60   -RUN apt-get -y install build-essential libfile-find-rule-perl libfile-find-rule-perl-perl imagemagick
61   -RUN apt-get -y install gettext unpaper git
62   -RUN apt-get -y install libtiff5 libpng12-0 libjpeg-turbo8 zlib1g libpango1.0-0 libcairo2 fontconfig libwebp5
63   -RUN apt-get -y install libpango1.0-0 libcairo2 libfontconfig1 libgettextpo0
64   -RUN apt-get -y install pkg-config libgcj14 libtiff-dev libpng-dev libopenjpeg-dev libjpeg8-dev libjpeg-turbo8-dev libjpeg-dev libgif-dev
65   -RUN apt-get -y install zlib1g-dev libicu-dev libpango1.0-dev libcairo2-dev libfontconfig1-dev libgettextpo-dev libnss3-dev
66   -
67   -RUN apt-get install -y gcc
68   -RUN apt-get install -y gcj-jdk
69   -RUN cd pdftk-2.02-dist/pdftk && make -f Makefile.Redhat all install
  52 +RUN wget https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk-2.02-src.zip && \
  53 + unzip pdftk-2.02-src.zip && rm -f pdftk-2.02-src.zip && \
  54 + cd pdftk-2.02-dist/pdftk && make -f Makefile.Redhat all install
70 55  
71 56 # Ghostscript 9.18 ou superior
72   -RUN wget http://downloads.ghostscript.com/public/old-gs-releases/ghostscript-9.18.tar.gz
73   -RUN tar xvozf ghostscript-9.18.tar.gz && rm -f ghostscript-9.18.tar.gz
74   -RUN cd ghostscript-9.18 && ls && ./autogen.sh; ./configure && make all install
  57 +RUN wget http://downloads.ghostscript.com/public/old-gs-releases/ghostscript-9.18.tar.gz && \
  58 + tar xvozf ghostscript-9.18.tar.gz && rm -f ghostscript-9.18.tar.gz && \
  59 + cd ghostscript-9.18 && ls && ./autogen.sh; ./configure && make all install
75 60  
76 61 RUN git clone https://github.com/coherentgraphics/cpdf-binaries.git && \
77 62 cp cpdf-binaries/Linux-Intel-64bit/cpdf /usr/bin
78 63  
79   -RUN apt-get -y install rsyslog libsys-syslog-perl
80   -
81 64 RUN useradd -m ocr
82 65  
83 66 RUN chmod +x /usr/local/bin/ocr && \
... ...