Deploying EFTLink within a Docker Container
Build Your Docker Image
-
Create a working directory.
For example:
mkdir $HOME/docker-build-files - Extract the contents from container.zip to your working directory.
- Copy the EFTLink binaries zip file (
v<xx>.0.0.<nnn>.binaries.zip) to your working directory. - Copy the
XST-jre-21.0.<XX>-linux_64.zip(from jrepackager) to your working directory. -
Within your working directory, run the following command from the command shell:
docker build \
--build-arg eftlink_zip=v<xx>.0.0.<nnn>.zip \
--build-arg jre_zip=XST-jre-21.0.<nnn>-linux_64.zip \
--build-arg eftlink_user_uid=<user uid> \
--build-arg eftlink_user_gid=<user gid> \
-f Dockerfile \
-t eftlink:latest .
For example:
docker build \
-build-arg eftlink_zip=v26.0.0.binaries.zip \
-build-arg jre_zip=XST-jre-21.0.12-linux_64.zip \
-build-arg eftlink_user_uid=9090 \
-build-arg eftlink_user_gid=9090 \
-f Dockerfile \
-t eftlink:latest .
This should build your docker image. Once finished, you can see the completed image by running the command:
docker image ls eftlink
Output:
REPOSITORY TAG IMAGE ID CREATED SIZE
eftlink latest 3a0e731911b4 6 hours ago 596MB
Running in Docker (Standalone)
You will need to decide which configuration files and directories will be need to be made persisted (outside of the Docker container).
To do this, create a working directory. For example:
mkdir $HOME/eftlink-config
Copy the required configuration files and directories into this location and configure them for your target environment.
An example of the recommended files and folders to persist are as follows:
| tmp | Provides access to anchor files |
| keys | Keystore |
| log | Provides access to logs |
| eftlinkserver.json | Framework configuration file. *Note* for traditional this would be EftlinkConfig.properties. |
| opiretail.json | Core configuration file |
| Lang<XX>.properties | Alter framework translations |
| Lang<XX>_OPIRetail.properties | Alter core translations |
| eftlink.conf | Provide access to wrapper configuraton. For example allows the socket mode to be changed from traditional TCP or WebSocket. |
| CardRange.xml | Alter circuit mappings |
Persisting these files and directories ensures that configuration changes, security artefacts, temporary data, and log files are retained across container restarts and upgrades.
The following example shows how to start an EFTLink container using simple bind mounts to make the configuration and data available outside the container:
docker run --name <container name> -user <username> -publish <host-port>:<container-port> /
-env EFTLINK_JAVA_HOME=<valuse> /
-volume <host path>:<container path>
-tty -rm -interactive -workdir /opt/eftlink eftlink--volume <working dir>/log:/opt/eftlink/log /
For example:
docker run -name eftlink -user eftlink -publish 10100:10100 /
-env EFTLINK_JAVA_HOME=/opt/jre /
-volume <working dir>/tmp:/opt/eftlink/tmp /
-volume <working dir>/keys:/opt/eftlink/keys /
-volume <working dir>/wrapper/conf/eftlink.conf:/opt/eftlink/wrapper/conf/eftlink.conf /
-volume <working dir>/log:/opt/eftlink/log /
-volume <working dir>/CardRange.xml:/opt/eftlink/CardRange.xml /
-volume <working dir>/log4j2.xml:/opt/eftlink/log4j2.xml /
-volume <working dir>/eftlinkserver.json:/opt/eftlink/eftlinkserver.json /
-volume <working dir>/opiretail.json:/opt/eftlink/opiretail.json /
-volume <working dir>/LangEN_OPIRetail.properties:/opt/eftlink/LangEN_OPIRetail.properties /
-tty -rm -interactive -workdir /opt/eftlink eftlink
To confirm that the container has started, check the logs file in your working directory or enter:
docker ps | grep <container_name_or_id>
For example:
docker ps | grep eftlink
64c8f733f45e eftlink "/opt/eftlink/startu…" 7 minutes ago Up 7 minutes (healthy) 0.0.0.0:8443->8443/tcp, :::8443->8443/tcp, 0.0.0.0:10100->10100/tcp, :::10100->10100/tcp, 10101-10200/tcp eftlink
Running EFTLink in Docker Swarm
If you want to run EFTLink within a Docker Swarm, follow these steps:
-
Create a Docker swarm:
docker swarm init --advertise-addr <IP ADDRESS>Verify the node has joined the swarm:
docker node ls -
Create an Overlay Network:
Create a Docker overlay network that EFTLink services will use to communicate:
docker network create --scope swarm --driver overlay xstVerify the network:
docker network ls -
Create Persistent Volumes:
The following directories should remain persistent outside of the container:
Container Path Purpose /opt/eftlink/tmp Temporary files and anchor files /opt/eftlink/keys Certificates and keystore /opt/eftlink/log EFTLink log files Create the required Docker volumes:
docker volume create eftlink-tmpdocker volume create eftlink-keysdocker volume create eftlink-log -
Create Docker Configs:
Docker Configs are used for static configuration files.
The recommended configuration files are:
- eftlinkserver.json
- opiretail.json
- CardRange.xml
- log4j2.xml
- Lang<XX>.properties
- Lang<XX>_OPIRetail.properties
-
Create a Docker Config for each file.
docker config create <descriptive_name> <file_location>For example:
docker config create eftlink-reg1-eftlinkserver.json ./eftlinkserver.json
docker config create eftlink-reg1-opiretail.json ./opiretail.json
docker config create eftlink-reg1-eftlink.conf ./wrapper/conf/eftlink.conf
docker config create eftlink-reg1-CardRange.xml ./CardRange.xml
docker config create eftlink-reg1-log4j2.xml ./log4j2.xml
docker config create eftlink-reg1-LangEN_OPIRetail.properties
List the available configs:
docker config lsInspect a config:
docker config inspect <config_name> - Create the Docker Stack.
-
Create a file named docker-compose-stack.yml containing the following example configuration.
version: "3.9" services: eftlink-reg1: hostname: reg1-eftlink image: eftlink:latest user: "9090:9090" environment: EFTLINK_JAVA_HOME: /opt/jre ports: - target: 10100 published: 10100 protocol: tcp mode: host deploy: replicas: 1networks: - xst volumes: - eftlink-tmp:/opt/eftlink/tmp - eftlink-keys:/opt/eftlink/keys - eftlink-log:/opt/eftlink/logconfigs: - source: eftlink-reg1-eftlinkserver.json target: /opt/eftlink/eftlinkserver.json - source: eftlink-reg1-opiretail.json target: /opt/eftlink/opiretail.json - source: eftlink-reg1-eftlink.conf target: /opt/eftlink/wrapper/conf/eftlink.conf - source: eftlink-reg1-CardRange.xml target: /opt/eftlink/CardRange.xml - source: eftlink-reg1-log4j2.xml target: /opt/eftlink/log4j2.xml - source: eftlink-reg1-LangEN_OPIRetail.properties target: /opt/eftlink/LangEN_OPIRetail.propertiesvolumes: eftlink-tmp: external: true eftlink-keys: external: true eftlink-log: external: true configs: eftlink-reg1-eftlinkserver.json: external: true eftlink-reg1-opiretail.json: external: true eftlink-reg1-eftlink.conf: external: true eftlink-reg1-CardRange.xml: external: true eftlink-reg1-log4j2.xml: external: true eftlink-reg1-LangEN_OPIRetail.properties: external: true networks: xst: external: true -
Deploy the Stack:
Deploy the application:
docker stack deploy -c docker-compose-stack.yml Eftlink-ExampleList the services:
docker stack services Eftlink-ExampleExample output:
IDNAMEMODEREPLICASIMAGEi43oqdgpwmchEftlink-Example_eftlink-reg1replicated1/1eftlink:latestView the running tasks:
docker stack ps Eftlink-ExampleView the service logs:
docker service logs Eftlink-Example_eftlink-reg1 -
Remove the stack.
docker stack rm Eftlink-ExampleRemove unused containers, networks and build cache:
docker system prune -fRemove unused volumes:
docker volume prune -fRemove all unused images:
docker image prune -a
Create a Docker overlay network that EFTLink services will use to communicate: