-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile_base
162 lines (139 loc) · 4.54 KB
/
Dockerfile_base
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
FROM ubuntu:18.04
MAINTAINER Savvas Paragkamian s.paragkamian@hcmr.gr
## for apt to be noninteractive
ENV DEBIAN_FRONTEND noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN true
# Basic ubuntu tools
RUN apt-get update && apt-get install -y wget \
&& apt-get install -qq -y curl
RUN apt-get update && apt-get install -y \
software-properties-common \
&& apt-get update
## install GIT and dependency preesed tzdata(requires interaction from user during installation), update package index, upgrade packages and install needed software
RUN truncate -s0 /tmp/preseed.cfg; \
echo "tzdata tzdata/Areas select Europe" >> /tmp/preseed.cfg; \
echo "tzdata tzdata/Zones/Europe select Athens" >> /tmp/preseed.cfg; \
debconf-set-selections /tmp/preseed.cfg && \
rm -f /etc/timezone /etc/localtime && \
apt-get update && \
apt-get install -y tzdata \
git-all
# R dependencies
RUN apt-get remove -y r-base-core \
&& apt-get update && apt-get install -y \
gfortran \
build-essential \
fort77 \
xorg-dev \
liblzma-dev \
libblas-dev \
gcc-multilib \
gobjc++ \
aptitude
RUN aptitude install -y libreadline-dev
RUN apt-get update && apt-get install -y libbz2-dev
RUN export CC=/usr/bin/gcc \
&& export CXX=/usr/bin/g++ \
&& export FC=/usr/bin/gfortran \
&& export PERL=/usr/bin/perl
# System libraries for tidyverse
RUN apt-get update && apt-get install -y \
libpcre3-dev \
libpcre2-dev \
libpcre-ocaml-dev \
libghc-regex-pcre-dev \
libxml2-dev \
libcurl4-openssl-dev \
libssl-dev \
&& apt-get update \
&& wget https://github.com/jgm/pandoc/releases/download/2.11.4/pandoc-2.11.4-1-amd64.deb \
&& dpkg -i pandoc-2.11.4-1-amd64.deb
# tesseract dependencies
## libraries for images, first, before leptonica
RUN apt-get update && apt-get install -y \
pkg-config \
automake \
libtool \
libpng-dev \
libjpeg8-dev \
libtiff5-dev \
zlib1g-dev \
libwebp-dev \
libopenjp2-7-dev \
libgif-dev \
libsdl-pango-dev \
libicu-dev \
libcairo2-dev \
bc \
&& apt-get update
## leptonica
WORKDIR /home
RUN wget http://www.leptonica.org/source/leptonica-1.80.0.tar.gz \
&& tar -zxf leptonica-1.80.0.tar.gz
WORKDIR /home/leptonica-1.80.0
RUN ./configure \
&& make \
&& make install
# Note that if building Leptonica from source, you may need to ensure that /usr/local/lib is in your library path. This is a standard Linux bug, and the information at Stackoverflow is very helpful.
# Main tools installation
# Ghostscript
WORKDIR /home
RUN wget https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs9533/ghostscript-9.53.3.tar.gz \
&& tar -xvf ghostscript-9.53.3.tar.gz
WORKDIR ghostscript-9.53.3
RUN ./configure \
&& make \
&& make install
# ImageMagick
WORKDIR /home
RUN wget https://download.imagemagick.org/ImageMagick/download/ImageMagick.tar.gz \
&& tar -zxf ImageMagick.tar.gz \
&& rm ImageMagick.tar.gz \
&& mv ImageMagick* ImageMagick
WORKDIR ImageMagick
RUN ./configure \
&& make \
&& make install
# jq
RUN apt-get update && apt-get install -y jq \
&& apt-get update
# tesseract OCR
WORKDIR /home
RUN wget https://github.com/tesseract-ocr/tesseract/archive/4.1.1.tar.gz \
&& tar -zxf 4.1.1.tar.gz
WORKDIR /home/tesseract-4.1.1
RUN ./autogen.sh \
&& ./configure \
&& LDFLAGS="-L/usr/local/lib" CFLAGS="-I/usr/local/include" make \
&& make install \
&& ldconfig
### ldconfig tells applications where they can find the linked libraries. That's why the above command can be needed after installing something new
#RUN make training
#RUN make training-install
### download the supporting languages of tesseract
WORKDIR /usr/local/share/tessdata
RUN wget https://github.com/tesseract-ocr/tessdata_best/raw/master/eng.traineddata \
&& wget https://github.com/tesseract-ocr/tessdata_best/raw/master/osd.traineddata
# gnfinder
WORKDIR /home
RUN wget https://github.com/gnames/gnfinder/releases/download/v0.11.1/gnfinder-v0.11.1-linux.tar.gz \
&& tar -zxf gnfinder-v0.11.1-linux.tar.gz \
&& mv gnfinder /usr/local/bin
# Install R
WORKDIR /home
RUN wget https://ftp.cc.uoc.gr/mirrors/CRAN/src/base/R-4/R-4.0.3.tar.gz \
&& tar -xf R-4.0.3.tar.gz
WORKDIR /home/R-4.0.3
RUN ./configure \
&& make \
&& make install \
&& Rscript -e 'install.packages("tidyverse", repos="https://cran.rstudio.com")'
# Clean the container
## cleanup of files from setup
RUN rm -rf /var/lib/apt/lists/* \
/tmp/* \
/home/*
# Change the root password by nothing at all.
RUN echo "root:Docker!" | chpasswd
# Set "deco" as my working directory when a container starts
WORKDIR /home