| Option | Description |
|---|---|
| Single container | Licensing Service and FRE worker packaged together. Simpler; good for testing, demos, and single-shot OCR jobs. |
| Two containers | Licensing Service and FRE worker in separate containers. Better fault tolerance; if one crashes, it can restart without interrupting the other. Multiple workers can share one Licensing Service. |
ubuntu:noble (24.04 LTS).
License types
FRE 12 accepts two types of licenses: Online and Local. Both types work in both single-container and two-container setups, but they have different activation and runtime requirements.Online license
Online license details
Online license details
- Filename pattern:
XXXXXXXXXXXXXXXXXXXX.ABBYY.ActivationToken - Validates against
*.abbyy.comat runtime — every container run needs internet access. - Requirements wherever the Licensing Service is installed:
- Active internet connection
- Allowed outbound HTTPS (port 443) to
*.abbyy.com - GoDaddy Trusted Root CA in the system
ca-certificatespackage (already present inubuntu:noble)
- Single Licensing Service instance can work with only one Online License at a time.
Local license
Local license details
Local license details
- Filename pattern:
XXXX-XXXX-XXXX-XXXX-XXXX-XXXX.ABBYY.LocalLicense - Activated at build time during FRE installation, then embedded in the image.
- Internet not required at runtime — good for air-gapped environments.
Getting started
To use either set-up option in this guide, you will need:- Docker and Docker Compose installed (
docker composev2 syntax) - ABBYY FineReader Engine 12 Linux installer:
FRE*.sh - License file (
.ABBYY.ActivationTokenor.ABBYY.LocalLicense) and password
Setup option 1 — Single container
Single container details
Single container details
This option runs the Licensing Service and the FRE worker in one container. The entrypoint starts the Licensing Service in the background, waits briefly for it to come up, runs the CLI sample, prints the output, and cleanly shuts down all processes on exit.Recommended for local testing, demos, and CI jobs where you just want one command to start and stop.
This is a two-stage build:
Files
Create an empty directory and add the following files:Dockerfile— builds the combined image (listed below)entrypoint.sh— starts the LS, runs the CLI sample, prints the result (listed below)docker-compose.yml— builds and runs the container (listed below).env— holds your license filename and password (listed below)
Build and run
-
Copy your
FRE*.shinstaller and license file into the directory you created above. -
Create a
.envfile with your license values (see below). -
From that directory, run the following command to build the image and start the container:
Demo.tif using OCR and prints the recognized text to the console..env
docker-compose.yml
Dockerfile
This is a two-stage build:- Stage 1 uses
gcc:8to install FRE and compile the CLI sample. - Stage 2 creates a minimal
ubuntu:nobleruntime image and copies in the Licensing Service binaries, the FRE runtime, the compiled sample, and the license file.
entrypoint.sh
Setup option 2 — Two containers
Two container details
Two container details
This option runs the Licensing Service and the FRE worker in separate containers on a shared Docker Compose network. The worker communicates with the Licensing Service over TCP at
A few things to notice:
This is a two-stage build:
This is a two-stage build:
The worker’s entrypoint is simpler than the single-container version because it does not manage the Licensing Service. The worker simply runs the sample and prints the output.
ls:3023.Recommended for production deployments. Running the services in separate containers means Docker can restart either one independently if it crashes. It also allows multiple workers to connect to the same Licensing Service.Files
Create an empty directory and add the following files:Dockerfile_ls— builds the Licensing Service container (listed below)Dockerfile_worker— builds the FRE worker container (listed below)entrypoint.sh— runs the CLI sample in the worker (listed below)docker-compose.yml— wires the two containers together (listed below).env— holds your license filename and password (same format as Setup 1)
Build and run
-
Copy your
FRE*.shinstaller and license file into the directory. -
Create a
.envfile with your license values. -
From that directory, run:
Demo.tif and prints the result.docker-compose.yml
- The worker uses
depends_on: [ls]so the Licensing Service container will start first. - Both services use
restart: on-failureallowing them to come back independently. - The worker’s
service_addressbuild argument isls:3023— Docker Compose’s built-in DNS resolveslsto the Licensing Service container. shm_size: 1gis configured on the worker, not the Licensing Service because FRE requires shared memory.
Dockerfile_ls
This is a two-stage build:- Stage 1 runs the FRE installer with
--skip-local-license-activationto extract the Licensing Service binaries. - Stage 2 creates a minimal
ubuntu:nobleruntime image, exposes port3023, and runsLicensingService /standaloneas PID 1. The/standaloneflag keeps the Licensing Service in the foreground, which is the right approach in Docker (a foreground process logs to stdout and exits cleanly when the container is stopped).
Dockerfile_worker
This is a two-stage build:- Stage 1 installs FRE with
--developer-installand--service-addresspointing at the Licensing Service container, then compiles the CLI sample. - Stage 2 creates a minimal
ubuntu:nobleruntime image containing only the FRE binaries, the compiled sample, and the demo image. Because the worker talks to thelscontainer over the network, No Licensing Service binaries are included.
entrypoint.sh
The worker’s entrypoint is simpler than the single-container version because it does not manage the Licensing Service. The worker simply runs the sample and prints the output.Customizing the CLI Sample
Both setup options run the same default command indocker-compose.yml:
-if— input file-f— output format profile-of— output file
Edit this line to point at a different input, output, or format profile. See the FRE Code Samples Library documentation for the full list of CLI arguments.
/app and point -if/-of at files inside it.
Common Issues
The following are known issues that apply to both setup options:shm_size: 1gis mandatory. FRE relies on POSIX shared memory and the default 64MB/dev/shmallocation is not enough. The compose files above already set this on the worker service.- The installer and license file must be in the build context. Both Dockerfiles
COPY FRE*.shand the license file — if they are not in the directory you are building from, the build fails immediately. Do not mount the license at runtime. It is activated during the build. - Online licenses need network egress from the builder and the runtime. The builder needs it to activate; the runtime Licensing Service needs it to keep validating.
- Do not commit license files or installers. In source control, add
.env,*.ABBYY.*, andFRE*.shto your ignore list, and do not include them in any published images unless you understand the implications and risks. - These examples use
ubuntu:noble(24.04 LTS). Previous documentation referred to Ubuntu bionic, which is end-of-life. Package names differ between Ubuntu releases. For example:libgcc-8-devis nowlibgcc-s1andlibstdc++-8-devis nowlibstdc++6. If you use a different base image, verify the package list accordingly.
