-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
67 lines (59 loc) · 2.47 KB
/
Dockerfile
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
#
# Dockerfile for tesseract
#
FROM ubuntu:16.04
MAINTAINER kev <mr.li.jinpeng@gmail.com>
RUN set -xe \
&& echo "deb http://us.archive.ubuntu.com/ubuntu trusty main universe" >> /etc/apt/sources.list \
&& apt-get update \
&& apt-get install -y autoconf \
build-essential \
git \
libcairo2 \
libcairo2-dev \
libgomp1 \
libicu55 \
libicu-dev \
liblept4 \
libleptonica-dev \
libpango1.0-0 \
libpango1.0-dev \
libtool \
libicu-dev \
fonts-wqy-zenhei \
&& git clone https://github.com/tesseract-ocr/tesseract.git \
&& cd tesseract \
&& ./autogen.sh \
&& ./configure \
&& make install \
&& make training \
&& make training-install \
&& ldconfig \
&& cd .. \
&& git clone https://github.com/tesseract-ocr/langdata.git \
&& git clone https://github.com/tesseract-ocr/tessdata.git \
&& cd tessdata \
&& mv * /usr/local/share/tessdata/ \
&& cd ..
# && apt-get purge --auto-remove -y autoconf \
# build-essential \
# git \
# libcairo2-dev \
# libicu-dev \
# libleptonica-dev \
# libpango1.0-dev \
# libtool \
# && rm -rf tesseract tessdata /var/cache/apk/*
RUN git clone https://github.com/JinpengLI/tesseract-trainer-docker.git /root/tesseract-trainer-docker
RUN set -xe && cd /root/tesseract-trainer-docker/example_train && ls && ./train.sh
## build a ssh server so that the user cannot use it from ssh
RUN apt-get update && apt-get install -y openssh-server
RUN mkdir /var/run/sshd
RUN echo 'root:screencast' | chpasswd
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
# SSH login fix. Otherwise user is kicked off after login
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
ENV NOTVISIBLE "in users profile"
RUN echo "export VISIBLE=now" >> /etc/profile
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]