Community

FineReader Engine in Docker container

It is possible to run ABBYY Finereader Engine (FRE) in virtualized environments, which allows you to create a highly scalable backend processing solution. This document will guide you through the deployment of FRE inside a Linux Docker container.

Prerequisites

  • FRE12 Installation file
  • FRE12 license with online activation token and password
  • FRE12 CustomerProjectID
  • Working Docker environment

NOTE: When working in virtual environments, an online license is highly recommended.

 

Step-by-step Guide

1. Make sure to have a working Docker environment and have the Docker daemon running

2. Create a new folder and create all the required files

 

3. Create a Dockerfile

FROM ubuntu:18.04

#system environment variable necessary for running FRE samples
ENV LD_LIBRARY_PATH=/opt/ABBYY/FREngine12/Bin

#obtain linux requirements
RUN apt-get update \
 && apt-get -y install ca-certificates \
 && apt-get -y install gettext-base \
 && apt-get -y install make \
 && apt-get -y install g++

#copy all required files to the container
COPY FRE12R3_Linux.sh /tmp/FRE12R3_Linux.sh
COPY ABBYYLicense.ActivationToken /tmp/ABBYYLicense.ActivationToken
COPY deploy.sh /tmp/deploy.sh
COPY run.sh /run.sh

#execute the deploy.sh to perform a silent installation of FRE using the necessary parameters
RUN /tmp/deploy.sh \
#execute FRE installation
 /tmp/FRE12R3_Linux.sh \
#specify installation folder
 /opt/ABBYY/FREngine12/ \
#specify path to License token
 /tmp/ABBYYLicense.ActivationToken \
#License token password
 MyPassword123456789
#CustomerProjectID
 MyCustomerProjectID

CMD ["/run.sh"]

 

4. Create a deploy script which will be executed upon container creation and performs a silent installation of Finereader Engine

#!/bin/bash
# (c) 2018 ABBYY Production LLC

install_file=$1
install_path=$2
license_path=$3
license_pass=$4
project_id=$5

echo Installing FREngine 12

$install_file -- --install-dir "$install_path" --license-path "$license_path" --license-password "$license_pass" --developer-install --project-id "$project_id"

cd "$install_path/Samples/CommandLineInterface"
make

exit 0

 

5. Create a script to start the licensing service and test the application

#!/bin/bash
# (c) 2018 ABBYY Production LLC

install_path=/opt/ABBYY/FREngine12

echo -- Run licensing service
service_folder="$install_path/CommonBin/Licensing"
LD_LIBRARY_PATH="$service_folder" "$service_folder/LicensingService" /start

echo -- Run FRE sample
cd "$install_path/Samples/CommandLineInterface"
LD_LIBRARY_PATH=../../Bin ./CommandLineInterface -pi -if ../SampleImages/Demo.tif -f PDF -of ./Demo.pdf

/bin/bash

 

6. Start a terminal session, navigate to your Docker folder and build your custom image, described in the Dockerfile, by using the following command:

docker build -t <image_name> .

(don´t forget to use the “.” if you run this command from the folder of your Dockerfile)

 

7. After the container has been created successfully, you can check if it is available with

docker images

 

8. Run the container based on your custom image

docker run –i –t <image_name>

 

NOTE: This is only one of many possible scenarios you can use FRE within a container environment. Depending on your use-case a different deployment method might be more appropriate.

Was this article helpful?

1 out of 1 found this helpful

Comments

2 comments

  • Avatar
    Anton Heitz (DE)

    Hi Stefan,

    Thanks for the great Guilde. I used the ubuntu:18.03 docker Image and for that there have to be a few changes:

    @Step 3:  changes to the Dockerfile... the locals have to be set and additional packet installed

    FROM ubuntu:18.04

    # set path variables

    RUN apt-get clean && apt-get -y update && apt-get install -y locales && locale-gen en_US.UTF-8

    # path to the ABBYY engine bin

    ENV LD_LIBRARY_PATH=/opt/ABBYY/FREngine12/Bin

    # install reqzurements for the FRE Install
    RUN apt-get update \
    && apt-get -y install ca-certificates gettext-base make g++ libgdiplus

    # copy files
    COPY FRE12_R4U3_Linux_x64_build_12_4_7_1122_part_1366_26.sh /tmp/FRE12_linux.sh
    COPY <Online Token Path> /tmp/ABBYYLicense.ActivationToken
    COPY deploy.sh /tmp/deploy.sh
    COPY run.sh /run.sh

    # install of FRE
    RUN /tmp/deploy.sh \
    /tmp/FRE12_linux.sh \
    /opt/ABBYY/FREngine12 \
    /tmp/ABBYYLicense.ActivationToken \
    <password> \
    <ProjectID>

    CMD ["/run.sh"]

     

    @Step 5: Change the second LD_LIBRARY_PATH in the run.sh to absolute path

    Change LD_LIBRARY_PATH=../../Bin

    to

    LD_LIBRARY_PATH="/opt/ABBYY/FREngine12/Bin"

     

    I hope this will help someone.

    0
  • Avatar
    Stefan Schmainta

    Hello Anton,

    Thank you very much for this. This is highly appreciated.

    And you are right - from when this initial guide has been created, the dependencies structure was modified minorly.

    Also for future reference: You can always take a closer look into the userguide and search for the "Docker container" section, to get a detailed overview of the required libraries.

    Thanks and have a great day.

    0

Please sign in to leave a comment.