forked from mobilelife/docker-python-opencv-tesseract
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·30 lines (25 loc) · 981 Bytes
/
build.sh
File metadata and controls
executable file
·30 lines (25 loc) · 981 Bytes
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
#!/usr/bin/env bash
# bash strict mode : http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail
IFS=$'\n\t'
LEPTONICA="leptonica-1.73.tar.gz"
TESSERACT="tesseract-master.tar.gz"
TESSERACT_MODEL="eng.traineddata"
if [ ! -d ./temp ]; then
mkdir ./temp
fi
#gogo
if [ ! -f ./temp/${LEPTONICA} ]; then
echo "leptonica not found, downloading tarball"
curl -L -o ./temp/${LEPTONICA} http://www.leptonica.org/source/leptonica-1.73.tar.gz
fi
if [ ! -f ./temp/${TESSERACT} ]; then
echo "tesseract not found, downloading tarball"
curl -L -o ./temp/${TESSERACT} https://github.com/tesseract-ocr/tesseract/archive/master.tar.gz
fi
if [ ! -f ./temp/${TESSERACT_MODEL} ]; then
echo "tessseract model not found, downloading"
curl -L -o ./temp/${TESSERACT_MODEL} https://github.com/tesseract-ocr/tessdata/raw/master/eng.traineddata
fi
echo "building docker container"
docker build --squash -t "dbmobilelife/docker-python-opencv-tesseract" .