Apama 10.15.0 | Deploying and Managing Apama Applications | Deploying Apama Applications with Docker | Licensing Apama in Docker
 
Licensing Apama in Docker
For on-premise installations of Apama, license files are typically added at installation time. However, the Docker image does not come with a license file by default. You have to provide it by yourself. There are several ways to accomplish this, depending on your deployment architecture and whether you may have different license files or may need to update them while the correlator is running.
The Docker server mounts the license file at runtime
The simplest method is to provide the license file on the Docker server when it launches correlator containers. To do this, you mount a copy of the license file into the correlator container at the standard location of /apama_work/license/ApamaServerLicense.xml. You can either do this from a local file or using a cluster-wide shared file system.
To do this with a simple docker run command from a node-local file system, run:
docker run \
-v/path/to/ApamaServerLicense.xml:/apama_work/license/ApamaServerLicense.xml \
  imagename
Mounts can also be provided in Docker Compose, Docker Stack or Kubernetes orchestration files. See the documentation for your orchestrator for more details.
The Docker server provides the license file via a configuration object
Both Docker Stack and Kubernetes support creating configuration objects in the stack, whose contents can be provided as a file mounted into the container at runtime.
Using Docker Stack, you need to create a stack configuration file which defines configuration. For example:
configs:
apama_license:
file: ./ApamaServerLicense.xml
Then you need to load the configuration to a particular location in your container:
services:
apama:
image: imagename
configs:
- source: apama_license
target: /apama_work/license/ApamaServerLicense.xml
The application image contains the license file
Alternatively, if you do not need to provide different license files at runtime (for example, while developing or testing), you can compile the license file into your application image. To do this, add a COPY line to your project Dockerfile which copies the license file to the standard location. For example:
COPY --chown=sagadmin:sagadmin ApamaServerLicense.xml \
$APAMA_WORK/license/ApamaServerLicense.xml
If you ever need to change the license file, you will need to rebuild your application image with the new license file.
The project contains the license file
You can also store the license file inside your Software AG Designer project and load it via configuration, rather than having it picked up automatically by the correlator. This also has the disadvantage of not being able to have a different license file in production, but means that your license file is automatically available wherever you run the project, whether in Docker or not, even if you did not initially install Apama with the license file.
To do this, you need to add a section to the Apama configuration file in your project, with a relative path to the license file which has been added to your project. For example:
correlator:
licenseFile: ${PARENT_DIR}/../ApamaServerLicense.xml
With this option, the license file and configuration will automatically be included in the application image using the default Dockerfile provided by Software AG Designer.
For more details, see YAML configuration file for the correlator.