mhf-ir commented on a change in pull request #2:
URL: https://github.com/apache/tika-docker/pull/2#discussion_r550784351



##########
File path: docker-tool.sh
##########
@@ -58,13 +60,18 @@ test_docker_image() {
 shift $((OPTIND -1))
 subcommand=$1; shift
 version=$1; shift
+tesseract_languages=$1; shift
 
 case "$subcommand" in
   build)
+    build_args="--build-arg TIKA_VERSION=${version}"
+    if [[ ! -z "$tesseract_languages" ]]; then
+      build_args="$build_args --build-arg 
TESSERACT_LANGUAGES='${tesseract_languages}'"
+    fi
     # Build slim version with minimal dependencies
     docker build -t apache/tika:${version} --build-arg TIKA_VERSION=${version} 
- < minimal/Dockerfile --no-cache
     # Build full version with OCR, Fonts and GDAL
-    docker build -t apache/tika:${version}-full --build-arg 
TIKA_VERSION=${version} - < full/Dockerfile --no-cache
+    docker build -t apache/tika:${version}-full ${build_args} - < 
full/Dockerfile --no-cache

Review comment:
       How about to run:
   ```bash
   ./docker-tool.sh build 1.25 'tesseract-ocr-eng tesseract-ocr-ita`
   ```

##########
File path: docker-tool.sh
##########
@@ -58,13 +60,18 @@ test_docker_image() {
 shift $((OPTIND -1))
 subcommand=$1; shift
 version=$1; shift
+tesseract_languages=$1; shift
 
 case "$subcommand" in
   build)
+    build_args="--build-arg TIKA_VERSION=${version}"
+    if [[ ! -z "$tesseract_languages" ]]; then
+      build_args="$build_args --build-arg 
TESSERACT_LANGUAGES='${tesseract_languages}'"
+    fi
     # Build slim version with minimal dependencies
     docker build -t apache/tika:${version} --build-arg TIKA_VERSION=${version} 
- < minimal/Dockerfile --no-cache
     # Build full version with OCR, Fonts and GDAL
-    docker build -t apache/tika:${version}-full --build-arg 
TIKA_VERSION=${version} - < full/Dockerfile --no-cache
+    docker build -t apache/tika:${version}-full ${build_args} - < 
full/Dockerfile --no-cache

Review comment:
       How about to run:
   ```bash
   ./docker-tool.sh build 1.25 'tesseract-ocr-eng tesseract-ocr-ita'
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to