-
Notifications
You must be signed in to change notification settings - Fork 12
/
zip_fct.sh
28 lines (28 loc) · 823 Bytes
/
zip_fct.sh
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
set -e
rm *.zip || true
rm -rf layer/ || true
rm -rf tessconfigs/ || true
rm -rf tesseractconfigs/ || true
rm -rf configs/ || true
# Download tessconfigs folder
git clone https://github.com/tesseract-ocr/tessconfigs.git tesseractconfigs
mv tesseractconfigs/configs .
mv tesseractconfigs/tessconfigs .
rm -rf tesseractconfigs || true
# Build Tesseract LAYER
docker build -t tess_layer -f Dockerfile-tess5.1.0 .
CONTAINER=$(docker run -d tess_layer false)
docker cp $CONTAINER:/opt/build-dist layer
docker rm $CONTAINER
cd layer/
zip -r ../tesseract-layer5.1.0best.zip .
# Clean
cd ..
rm -rf layer/ || true
rm -rf tessconfigs/ || true
rm -rf tesseractconfigs/ || true
rm -rf configs/ || true
#Build docker image and push to ECR
docker build -t lambda-ocr .
docker tag lambda-ocr:latest yourURI:v0.1
docker push yourURI:v0.1