> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Running ABBYY FlexiCapture 12 SDK inside a Docker container

This section provides the instructions on running ABBYY FlexiCapture 12 SDK inside the Docker container. Two alternative scenarios are described: you may use ABBYY Licensing Service either inside the container or outside the container.

An [Online License](https://docs.abbyy.com/flexi-capture/sdk/introduction/onlinelicensing.md), which connects to **\*.abbyy.com** license server, is used for both cases.

> [!NOTE]
>
> ABBYY Licensing Service can work with only one Online License at the same time.

You need:

* your Customer Project ID
* an Online License token file
* the password to the license token file

You need to fulfill the following conditions for using an Online License wherever ABBYY licensing service is installed:

* Active Internet connection
* Allowed connections to **\*.abbyy.com** on port **443**

Before launching the Docker container in which ABBYY FlexiCapture SDK will run, you need to:

1. Download and install Docker for Windows on your machine as described on the official Docker [website](http://docs.docker.com/docker-for-windows/install/).

2. Enable Hyper-V and Containers Windows features.

3. Switch to Windows Containers using the Docker desktop menu.

4. Download an image of Windows to be installed into the container:

   ```bash theme={null}
   docker pull mcr.microsoft.com/windows/servercore:<tag>
   ```

5. Create an empty directory and put into it:
   * **InstallerFolder** — a directory with ABBYY FlexiCapture SDK distribution kit
   * **TestAppFolder** — a directory with
     * **Online License token file**
     * **test application** compiled to use this token file as well as the password to it and your Customer Project ID
   * **DeployFCSDK.cmd** — a command-line script to install ABBYY FlexiCapture 12 SDK
   * **TestFCSDK.cmd** — a command-line script to run the **test application**
   * **Dockerfile** — a file with the settings for the container to be created. This file must contain:

     ```dockerfile theme={null}
     FROM mcr.microsoft.com/windows/servercore:<tag>
     WORKDIR /app
     ADD . /app
     RUN DeployFCSDK.cmd
     CMD TestFCSDK.cmd
     ```

## Licensing Service outside the container

## ABBYY Licensing Service should be installed outside the container if all containers use one Online License.

Follow the instruction:

1. Make sure the network port on a machine with Licensing Service is opened in your firewall security settings (ABBYY Licensing Service uses 3024 port by default).

2. Make sure the **LicensingSettings.xml** file on a machine with Licensing Service contains the following settings:

   ```xml theme={null}
   <LocalLicenseServer>
     <ConnectionProtocol ProtocolType="TCP/IP" />
   </LocalLicenseServer>
   ```

3. Use the ABBYY FlexiCapture SDK 12 Runtime (x64)**.exe** file to install ABBYY FlexiCapture 12 SDK at runtime on 64-bit Windows by specifying inside the **DeployFCSDK.cmd** the following command (the *servername* parameter is the host address where the Licensing Server is installed):

   ```bat theme={null}
   .\InstallerFolder\"ABBYY FlexiCapture SDK 12 Runtime (x64).exe" /qb /v INSTALLDIR="LibraryInstallationPath" SERVERNAME=<LicensingServer_host_Address> LICENSESRV=No
   ```

4. To run the **test application**, specify the following commands inside the **TestFCSDK.cmd**:

   ```bat theme={null}
   .\<TemplateFolder>\Test.exe
   ```

   The **TestFCSDK.cmd** script will be run automatically after launching the container.

5. Open the command line and start the container building process:

   ```bash theme={null}
   docker build -t <name>
   ```

6. Run this command to specify an image to derive the container from after the building process succeeds:

   ```bash theme={null}
   docker run <name>
   ```

   To make an Online License available for all containers you must run any application which uses this license on a machine with Licensing Service (see [Developing online-licensed applications](https://docs.abbyy.com/flexi-capture/sdk/introduction/onlinelicensing.md#developing-ol-applications)).

   If you have a problem connecting to ABBYY Licensing Service, please make sure your **LicensingSettings.xml** file in **LibraryInstallationPath\\** folder inside the container has these settings:

   ```xml theme={null}
   <LicensingServers>
     <MainNetworkLicenseServer ServerAddress="LicensingServer_host_Address" ProtocolType="TCP/IP" />
   </LicensingServers>
   ```

## Licensing Service inside the container

To install the Licensing Service, refer to the [Installing the Licensing Service](https://docs.abbyy.com/flexi-capture/sdk/distribution/installinglicenseservice.md).

Follow the instruction:

1. Use the ABBYY FlexiCapture SDK 12 Runtime (x64)**.exe** file to install ABBYY FlexiCapture 12 SDK at runtime on 64-bit Windows by specifying inside the **DeployFCSDK.cmd** the following command:

   ```bat theme={null}
   .\InstallerFolder\"ABBYY FlexiCapture SDK 12 Runtime (x64).exe" /quiet INSTALLDIR="LibraryInstallationPath"
   ```

2. To run the **test application**, specify the following command inside the **TestFCSDK.cmd**:

   ```bat theme={null}
   .\<TemplateFolder>\Test.exe
   ```

   The **TestFCSDK.cmd** script will be run automatically after launching the container.

3. Open the command line and build an image from a container:

   ```bash theme={null}
   docker build -t <name>
   ```

4. Run this command to create a container layer over the image and start it:

   ```bash theme={null}
   docker run <name>
   ```

## See also

[Installing the Licensing Service](https://docs.abbyy.com/flexi-capture/sdk/distribution/installinglicenseservice.md)

[Licensing](https://docs.abbyy.com/flexi-capture/sdk/licensing/licensing.md)

[Activation](https://docs.abbyy.com/flexi-capture/sdk/licensing/activation.md)
